fix TypeDef parser to consume optional = before field block

type User = { name: String } was silently broken: the parser consumed
the type name then called expect(LBrace) while sitting on the = token.
expect() advances unconditionally on mismatch, so it consumed = and
treated { as the first field name, producing a corrupt TypeDef node.

The FnDef following the broken TypeDef was then parsed incorrectly or
lost entirely -- causing greet() and similar functions to vanish from
JS/C output with no error.

Fix: detect and skip the optional Eq token before expecting LBrace.
Both targets benefit; rebuild elc to pick up the fix.
This commit is contained in:
Will Anderson
2026-05-04 10:36:53 -05:00
parent 0f1da43a97
commit 7376349124
2 changed files with 6 additions and 1 deletions
BIN
View File
Binary file not shown.