Skip to content

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

@FreeBlues

Description

@FreeBlues

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions