Skip to content

v0.5.0

Choose a tag to compare

@chharvey chharvey released this 06 Jan 06:18
· 87 commits to main since this release

Non-Breaking

  • memoize reusable list productions, fixing a bug where repeating a list would cause a reduce-reduce conflict.

    Alpha ::= Beta+ Gamma;
    Delta ::= Beta+ Epsilon;
    

    previously expanded to

    Alpha__0__List ::= Alpha__0__List? Beta;
    Alpha ::= Alpha__0__List Gamma;
    Delta__0__List ::= Delta__0__List? Beta;
    Delta ::= Delta__0__List Epsilon;
    

    Then the instance Beta Beta Beta would cause a reduce-reduce conflict: “should the parser reduce to Alpha__0__List or Delta__0__List?”

    Now, the EBNF builder is smart enough to reuse the item Beta+, and produce the following expansion:

    Alpha__0__List ::= Alpha__0__List? Beta;
    Alpha ::= Alpha__0__List Gamma;
    Delta ::= Alpha__0__List Epsilon;
    

    Now Beta Beta Beta unambiguously reduces to Alpha__0__List.