Skip to content

The latest lpeg(0.12.1) does not support left-recuision #2

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

Open
FreeBlues opened this issue Jul 5, 2017 · 0 comments
Open

The latest lpeg(0.12.1) does not support left-recuision #2

FreeBlues opened this issue Jul 5, 2017 · 0 comments

Comments

@FreeBlues
Copy link

The latest lpeg(0.12.1) does not support left-recuision, alway throw error "empty loop in rule ..."

So the grammar in parser.lua should remove the left-recursion.

I found these syntax used left-recursion:

prefixexp ::= var | functioncall | ‘(’ exp ‘)’
functioncall ::= prefixexp args | prefixexp ‘:’ Name args
var ::= Name | prefixexp ‘[’ exp ‘]’ | prefixexp ‘.’ Name

and this:

exp ::= nil | false | true | Numeral | LiteralString | ‘...’ | functiondef |
prefixexp | tableconstructor | exp binop exp | unop exp

I know the errors but can not correct them because I am studying the LPEG now and have not got it.

Please correct them or waiting for me until I had understood the LPEG clearly.

Sorry for my poor english.

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