Commit Graph

15 Commits

Author SHA1 Message Date
84c578d31b update skill 2026-02-14 15:27:28 +02:00
a263259b1e astgen: implement namespace scopes, identifier resolution across scope boundaries
Add ScopeNamespace struct with per-namespace declaration tables and
capture storage, replacing the flat decl_table on AstGenCtx. Implement
tunnelThroughClosure for cross-namespace captures (closure_get ZIR
instruction). Modify identifierExpr to walk past namespace scopes,
checking namespace decls and tracking num_namespaces_out for proper
closure tunneling.

Key changes:
- ScopeNamespace with decl_names/decl_nodes, capture_keys/capture_vals
- scanContainer populates per-namespace decls instead of flat table
- structDeclInner/enumDeclInner create namespace scopes, write captures
- globalVarDecl/fnDecl/testDecl/comptimeDecl receive scope parameter
- localVarRef properly tunnels through namespace boundaries
- scopeParent helper for generic scope chain walking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 12:51:38 +00:00
285935bd41 astgen: implement 20+ builtins, multi-arg dispatch, extended helpers
Add builtins: @sizeOf, @alignOf, @typeInfo (simpleUnOpType pattern),
@compileError, @setEvalBranchQuota, @typeName (simpleUnOp pattern),
@This (addNodeExtended), @memmove, @FieldType, @reduce,
@addWithOverflow/@subWithOverflow/@mulWithOverflow/@shlWithOverflow
(overflowArithmetic), @alignCast/@constCast/@volatileCast (ptrCast
family), @errSetCast, @Type (reify), @TypeOf (typeof_builtin block),
@unionInit (3-arg via builtinCallMultiArg), @intFromPtr, @intFromBool,
@floatFromInt, @intFromFloat, @floatCast.

Add helper functions: addNodeExtended, addExtendedPayload,
addExtendedPayloadSmall. Add is_typeof field to GenZir.
Add AST_NODE_BUILTIN_CALL dispatch for 3+ arg builtins.
Add COMPTIME_REASON_COMPILE_ERROR_STRING and UNION_FIELD_NAME.

Add skipped corpus tests for array_list.zig, multi_array_list.zig,
Sema.zig (blocked on identifier resolution across namespace scopes).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 12:25:39 +00:00
b10557306d astgen: blockExpr rvalue, local_ptr rvalue, array_mult
- blockExpr: call rvalue on void result for unlabeled blocks, matching
  upstream AstGen.zig:2431. This was causing a missing STORE_NODE when
  empty blocks like {} were used as struct field values with pointer RL.
- identifierExpr: call rvalueNoCoercePreRef after LOAD in local_ptr case,
  matching upstream AstGen.zig:8453-8454.
- Implement AST_NODE_ARRAY_MULT (** operator) with ArrayMul payload,
  matching upstream AstGen.zig:774-785.
- Enable parser_test.zig and astgen_test.zig corpus tests.
- Enable combined corpus test (all 5 files pass).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:19:36 +00:00
28ee5d40b7 astgen: switchExprErrUnion, decl_val rvalue, identAsString ordering
Port switchExprErrUnion optimization for both catch and if patterns,
fix missing rvalue call in decl table lookup, fix identAsString
ordering for underscore error captures, and fill value_placeholder
with 0xaa to match upstream undefined pattern.

Enables corpus build.zig test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:54:28 +00:00
b2592f40be astgen: catch error capture, @panic, @errorName, @field, larger block scopes
- Add error capture scope to orelseCatchExpr (catch |err| now creates
  a ScopeLocalVal for the captured error variable)
- Add @panic, @errorName, @field builtins
- Increase blockExprStmts scope arrays from 64 to 128 entries
  (build.zig has 93 var decls in a single block)

corpus build.zig still skipped: needs switchExprErrUnion optimization
(catch |err| switch(err) pattern).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:15:14 +00:00
3aced7124e skip build.zig astgen test 2026-02-14 10:58:12 +02:00
bafa089ed5 move module up 2026-02-14 10:53:08 +02:00
ef184ddff0 update skill 2026-02-14 10:27:59 +02:00
7e6398a4e4 Merge commit '6204bb245b4a05e0f4f00bb48d83b76ebcd899e2' into zig0-0.15.2 2026-02-14 10:05:42 +02:00
75759cc163 bump version 2026-02-14 01:48:19 +02:00
df33cfafde rm check_test_order.py 2026-02-14 01:40:13 +02:00
bb0b04c575 Merge commit '0b12e027a3628e26a765126d9937a2366b638ff3' into zig0-0.15.1 2026-02-14 00:07:36 +02:00
7c8248c241 stage0-specific changes 2026-02-14 00:03:26 +02:00
b81f72bab3 Add 'stage0/' from commit 'b3d106ec971300a9c745f4681fab3df7518c4346'
git-subtree-dir: stage0
git-subtree-mainline: 3db960767d
git-subtree-split: b3d106ec97
2026-02-13 23:32:08 +02:00