Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternations ambiguity may not be detected with short repetitions #854

Closed
bd82 opened this issue Nov 19, 2018 · 1 comment
Closed

Alternations ambiguity may not be detected with short repetitions #854

bd82 opened this issue Nov 19, 2018 · 1 comment
Labels

Comments

@bd82
Copy link
Member

bd82 commented Nov 19, 2018

    $.RULE("A", () => {
      $.OR([
        // both these alternatives start with ("@")*
        { ALT: () => $.SUBRULE($.B) },
        { ALT: () => $.SUBRULE($.C) }
      ]);
    });

    $.RULE("B", () => {
      $.MANY(() => {
        $.SUBRULE($.D)
      })
      $.CONSUME(t.Class)
    });

    $.RULE("C", () => {
      $.MANY(() => {
        $.SUBRULE($.D)
      })
      $.CONSUME(t.Interface)
    });

    $.RULE("D", () => {
      $.CONSUME(t.At);
    });
@bd82 bd82 added the Bug 🪲 label Nov 19, 2018
@bd82 bd82 changed the title Alternations ambiguity not detected Alternations ambiguity may not be detected when short repetitions Dec 14, 2018
@bd82 bd82 closed this as completed in ed4c75e Dec 14, 2018
@bd82 bd82 changed the title Alternations ambiguity may not be detected when short repetitions Alternations ambiguity may not be detected with short repetitions Dec 29, 2018
@bd82
Copy link
Member Author

bd82 commented Dec 29, 2018

The repetitions Tokens were only counted once in a possible lookahead path.
This means that inputs such as : "@@ Interface" or "@@ Class" would not be identified at all
as there was more than a single repetition present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant