Skip to content

v0.6.2 — Grammar fixes for code generation blocks

Choose a tag to compare

@anzory anzory released this 08 Apr 17:07
· 37 commits to master since this release

Fixed

  • Grammar false-positives in code generation { ... } blocks. Two real-world SolidCAM postprocessor patterns were rejected by the parser under SLL prediction mode:
    • Multiple formatted outputs separated by juxtaposition, e.g. { nl, ';'tool_number:'<T>z2.0(p)!=' ': 'tool_name_comment'' }. Left-factored unconditionalCodeGenerationMember to unformattedOutput formatOfOutput? so SLL can decide without full-context lookahead.
    • Explicit + concatenation inside { ... }, e.g. { nl, ';HEADER ' + upper(version) + ' ' + date }. Added optional Plus to codeGenerationStringExpression so both juxtaposition and explicit + parse identically.
  • Test harness: parser tests now use PredictionMode.SLL to match production — the v0.6.1 harness silently masked these SLL-specific bugs by running in implicit LL mode.

Added

  • 5 regression tests covering both grammar bugs plus an anti-regression test for the juxtaposition style.

Changed

  • Decision 029 documents the left-factoring rule and codegen + fix; decision 028 corrected with a note that the original "tests pass identically" claim was based on a faulty test harness.