Skip to content

Brace use in productions. #108

@kfsone

Description

@kfsone

Tripped myself on subtle difference between token and production definitions :)

identifier: 'a'-'z' { 'a'-'z' };

File: Enum;
Enum: "enum" identifier "{" { identifier } "}";

->

Parse error: Error: {(13) { @ 4:29, expected one of: | ; g_sdt_lit prodId tokId string_lit

which is the unquoted open brace:

Enum: "enum" identifier "{" { identifier } "}";
                             ^
12345678901234567890123456789

Obviously, I need to use the alternate structure here, but I'm just curious if it wouldn't actually just make sense to have that effect achieved by introducing the use of '{' in productions anyway?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions