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

Nearley's own grammar is ambiguous? #629

Open
Antony74 opened this issue Jan 7, 2023 · 0 comments
Open

Nearley's own grammar is ambiguous? #629

Antony74 opened this issue Jan 7, 2023 · 0 comments

Comments

@Antony74
Copy link

Antony74 commented Jan 7, 2023

const fs = require('fs');
const nearley = require('nearley');
const grammar = require('nearley/lib/nearley-language-bootstrapped');

const parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar));

const text = fs.readFileSync(
    'node_modules/nearley/lib/nearley-language-bootstrapped.ne',
    { encoding: 'utf-8' }
);

parser.feed(text);
parser.finish();

console.log(parser.results.length);

EXPECTED: 1
ACTUAL 2

@Antony74 Antony74 changed the title Nearley's own grammar is ambigous? Nearley's own grammar is ambiguous? Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant