Commit 41efa0b
JST-PG-004: Simplified lowerer in JS (lowerer.js)
Hand-written lowerer (~2,075 lines JS) that transforms parser.js AST into
flat SSA IR consumed by infer.js and codegen.js. Three-pass module lowering:
types → functions → top-level script.
Handles: variable scope, if/elseif/else with phi nodes, while/for loops
with header phis, break/continue, try/catch/finally, short-circuit &&/||,
struct construction, field access, array indexing, closures/lambdas,
string interpolation, compound assignment, 15 pre-expanded macros.
114 new tests, 612 total passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 5652e1a commit 41efa0b
2 files changed
Lines changed: 2388 additions & 0 deletions
0 commit comments