Compare five real examples across four targets on three measured platforms, preserving raw samples, independent output verification and artifact provenance. Complete the WebAssembly support needed by the examples, inspect ZX bundles, prune generated C dependencies while preserving C++ linkage, and validate native script execution. Optimize only the temporary bootstrap seed and retain fresh-build measurements and historical benchmark records under bench/results. Local tests: all 522 cases passed across the full run and corrected header-test rerun; all 16 bootstrap modules match. Playground runtime, bundle runtime, private browser layouts and matrix controls, published artifacts and local site links passed.
83 lines
2.0 KiB
C
83 lines
2.0 KiB
C
/* Generated by zi2c from compiler_statement.zi. */
|
|
#ifndef ZIRAN_COMPILER_STATEMENT_H
|
|
#define ZIRAN_COMPILER_STATEMENT_H
|
|
|
|
#include <stdbool.h>
|
|
#include "zir_string_types.h"
|
|
#include "compiler_scan.h"
|
|
#include "compiler_source.h"
|
|
#include "compiler_text.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
typedef int32_t LoopKind;
|
|
typedef struct LoopHeader LoopHeader;
|
|
typedef struct NamedWhile NamedWhile;
|
|
typedef struct LoopControl LoopControl;
|
|
typedef int32_t ControlError;
|
|
typedef struct ControlLine ControlLine;
|
|
typedef struct CompileHeader CompileHeader;
|
|
|
|
enum {
|
|
LoopKind_Invalid = 0,
|
|
LoopKind_Range = 1,
|
|
LoopKind_Collection = 2,
|
|
};
|
|
|
|
struct LoopHeader {
|
|
LoopKind kind;
|
|
String value_name;
|
|
String index_name;
|
|
String first;
|
|
String last;
|
|
String collection;
|
|
bool reverse;
|
|
bool pointer;
|
|
bool c_style;
|
|
};
|
|
|
|
struct NamedWhile {
|
|
bool valid;
|
|
String name;
|
|
String condition;
|
|
};
|
|
|
|
struct LoopControl {
|
|
bool valid;
|
|
String name;
|
|
};
|
|
|
|
enum {
|
|
ControlError_None = 0,
|
|
ControlError_Condition = 1,
|
|
};
|
|
|
|
struct ControlLine {
|
|
ControlError error;
|
|
String header;
|
|
String inline_body;
|
|
String queued_body;
|
|
};
|
|
|
|
struct CompileHeader {
|
|
int32_t kind;
|
|
String condition;
|
|
};
|
|
ControlLine compiler_statement_SplitControlLine(String source);
|
|
CompileHeader compiler_statement_CompileCondition(String source);
|
|
bool compiler_statement_CompileElse(String source);
|
|
bool compiler_statement_StartsCompileCondition(String source);
|
|
LoopHeader compiler_statement_ForHeader(String source, int64_t name_limit, int64_t text_limit);
|
|
NamedWhile compiler_statement_WhileHeader(String source, int64_t name_limit, int64_t text_limit);
|
|
LoopControl compiler_statement_ControlTarget(String source, bool continuation, int64_t name_limit);
|
|
bool compiler_statement_Mentions(String source, String name);
|
|
bool compiler_statement_Changes(String source, String name, bool assignment);
|
|
bool compiler_statement_PlainName(String source);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ZIRAN_COMPILER_STATEMENT_H */
|