Skip to content

Fix ambiguous grammar #129

@wwerner

Description

@wwerner

We have some ambiguous rules for numbers, i.e. BYTE_LITERAL and DECIMAL_LITERAL, so antlr matches the one that was defined first.

In int answer = 42 , it matches the number as BYTE_LITERAL and complains that it requires an INT_LITERAL . Once the number contains underscores or exceeds the byte range, it matches correctly.

Now I'm wondering whether I missed sth. (antlr version/config) or if it is just an error. That was implemented before my time so I can't say whether there is a reason for it I don't understand or if it's just a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P:1Highest PrioritybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions