fix: correct enum value rewriting and parser quoted-string handling #16

Closed
agent-engineering wants to merge 1 commit from fix/compiler-enum-rewrite-parser-quotes into main

1 commit

Author SHA1 Message Date
ade3fe2177 fix: correct enum value rewriting and parser quoted-string handling
Two bugs fixed:

1. TS Generator: Enum values in guard expressions and emit fields
   were prefixed with the wrong enum name (always using the state
   enum). Now builds a value→enumName map from enumMap and passes it
   to rewriteExpr so each value gets its correct enum prefix
   (e.g., ArtifactKind.Provenance instead of CompilerPhase.Provenance).

2. Parser: emit field splitting used simple comma-split which broke
   quoted strings containing commas (e.g., join(outputDir, ".prov.jsonld")).
   Now respects quotes and parentheses when splitting.

Also: join() calls now generate path.join() instead of String.join(),
and generated TS includes 'import path from path'.

Fixes: marcus/engineering#9
2026-05-05 21:50:49 -07:00