3 ms·
> there's nothing in-the-framework that's stopping you from becoming exponential. Recursive-descent parsing is executing a logic program, so couldn't you preve
by catnaroek 10y ago
> there's nothing in-the-framework that's stopping you from becoming exponential.
Recursive-descent parsing is executing a logic program, so couldn't you prevent backtracking by adding a `cut` operator? That's essentially what LL(1) parsing gives you: an implicit `cut` after successfully selecting a branch.
- lihaoyi 10y agoYes, there is a `cut` operator, and it does exactly what you expect. It's heavily documented here http://www.lihaoyi.com/fastparse/#Cuts http://www.lihaoyi.com/fastparse/#Cuts Just because there's a `cut` operator doesn't mean people will use it though =P
- catnaroek 10y agoOh, very nice. :-)