|
|
202733edbc
|
astgen: implement ZIR generation for basic expressions and declarations
Mechanical translation of AstGen.zig into C. Implements:
- Container members: comptime, simple_var_decl, test_decl, fn_decl
- Expressions: number_literal, string_literal, identifier (with
primitive types, integer types, and decl_val/decl_ref resolution),
field_access (field_val/field_ptr), address_of, builtin_call
(@import), array_type, array_init (with inferred [_] length),
array_cat (++), ptr_type
- Statement types: assign with _ = expr discard pattern
- Test infrastructure: testDecl, addFunc, fullBodyExpr,
blockExprStmts, emitDbgNode/emitDbgStmt, rvalueDiscard
- Support: GenZir sub-block instruction tracking, result location
propagation (RL_NONE/RL_REF/RL_DISCARD), string dedup, import
tracking, namespace decl table, lastToken, firstToken
1/5 corpus files pass (test_all.zig). Remaining 4 skip gracefully
via has_compile_errors when encountering unimplemented features.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-02-11 21:32:37 +00:00 |
|