code wiki / (root) / nx_macro_nest_gate.nx

nx_macro_nest_gate.nx

buildroot/runtime/nx_macro_nest_gate.nx

3449 B86 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic macro
docsdependenciesstructsconstsfunctions

about

nx_macro_nest_gate.nx -- NESTED conditional chains and @elif arm selection. WHY SEPARATE FROM nx_macro_v6_test. v6 exercises the EXPRESSION side of @if (comparison, arithmetic, &&, ||). It never nests a chain inside another chain, and never has two true @elif arms. Those are exactly the cases a single shared already-taken flag gets WRONG -- and it errs toward compiling EXTRA arms, which link and run. An implementation with no branch STACK passes all of v6 and still miscompiles every nested conditional in the corpus. Every block that must be dropped carries a poison identifier that exists nowhere in the corpus, AND redefines the same function name -- so a wrong arm selection fails TWICE over: undefined identifier AND duplicate symbol. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_kernel_v2.nx nx_macro_nest_gate.nx

imports: nx_kernel_v2.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nest_pick arm_pick mixed_pick swallow_pick

structs

none

consts

none

functions

20func nest_pick() -> nx_int { return BROKEN_INNER_TRUE_ARM_TAKEN }
called by 1: main
22func nest_pick() -> nx_int { return 1 }
25func nest_pick() -> nx_int { return BROKEN_OUTER_ELSE_TAKEN }
30func arm_pick() -> nx_int { return BROKEN_FALSE_IF_ARM_TAKEN }
called by 1: main
32func arm_pick() -> nx_int { return 2 }
34func arm_pick() -> nx_int { return BROKEN_SECOND_TRUE_ELIF_ALSO_TAKEN }
36func arm_pick() -> nx_int { return BROKEN_ELSE_AFTER_A_TAKEN_ARM }
42func mixed_pick() -> nx_int { return 3 }
called by 1: main
45func mixed_pick() -> nx_int { return BROKEN_MIXED_DEPTH_MISCOUNT }
51func swallow_pick() -> nx_int { return BROKEN_DEAD_NESTED_TRUE_ARM_EMITTED }
called by 1: main
53func swallow_pick() -> nx_int { return BROKEN_DEAD_NESTED_ELSE_EMITTED }
56func swallow_pick() -> nx_int { return 4 }
59func main() -> nx_exit