lua-fish icon indicating copy to clipboard operation
lua-fish copied to clipboard

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

Open FreeBlues opened this issue 7 years ago • 0 comments

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.

FreeBlues avatar Jul 05 '17 06:07 FreeBlues