Closed UkonnRa closed 2 years ago
That's a core problem with the parser Pest generates with can only parse LL grammars. A left recursive parser should be Earley or GLR/GLL.
@xacrimon, that is not very accurate. pest uses parsing expression grammars.
Ah, my fault. I am quite new to parsers.
Say a piece of code:
I want to parse
code
as the result:I can use lalrpop-script like this:
But the same code written in pest-script:
Will throw an error:
I have found the all-hand-written calculator in
pest/test
, so must I written like that if I want to deal with theleft-recursive
problem? Any better idea?