We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The OMeta paper describes mutual left recursion as a supported feature, but it appears broken in parsley.
Consider a simple left recursive grammar (this works):
exp = """\ num = <digit+>:n -> int(n) expr = expr:e "-" num:n -> e - n | num """ compiled = makeGrammar(exp, {}) print(compiled("4-3").expr())
->
1
Now lets modify the grammar precisely as done in the paper: replacing expr in the expr recursion with another rule x that calls into expr:
exp = """\ num = <digit+>:n -> int(n) x = expr expr = x:e "-" num:n -> e - n | num """ compiled = makeGrammar(exp, {}) print(compiled("4-3").x())
Traceback (most recent call last): File "./t.py", line 36, in <module> print(compiled("4-3").x()) File "/home/robertc/.virtualenvs/scratch/local/lib/python2.7/site-packages/parsley.py", line 98, in invokeRule raise err ometa.runtime.ParseError: 4-3 ^ Parse error at line 1, column 2: expected EOF. trail: [digit]
If run with expr rather than x, the result is the same.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The OMeta paper describes mutual left recursion as a supported feature, but it appears broken in parsley.
Consider a simple left recursive grammar (this works):
->
Now lets modify the grammar precisely as done in the paper: replacing expr in the expr recursion with another rule x that calls into expr:
->
If run with expr rather than x, the result is the same.
The text was updated successfully, but these errors were encountered: