cfcedff7f4be660f34afc4e3aa0e6aa56dabf326
Add cg_match_stmt() to lower match-as-statement to proper C if/else if/else
chains. Previously, match in statement position fell through to cg_expr() which
emitted a GCC statement-expression — fine for expression arms but wrong for the
statement form. Now matched using the same dispatch pattern as If and For in the
Expr handler of cg_stmt().
Pattern dispatch mirrors cg_match (expression form):
LitStr -> str_eq(subj, EL_STR("..."))
LitInt -> subj == N
LitBool -> subj == 1 / 0
Binding -> else { el_val_t name = subj; body; }
Wildcard -> else { body; }
Subject is evaluated once into a scoped temporary to avoid double evaluation.
Description
The Engram programming language — types as knowledge nodes, quantum-sealed prod target
139 MiB
Releases
5
El SDK (latest)
Latest
Languages
Emacs Lisp
86.3%
C
11.4%
HTML
1.7%
JavaScript
0.4%
Shell
0.2%