Closed rcrogers closed 8 years ago
I found GobbleUp
: https://github.com/kschiess/parslet/blob/66e242841ea27554a64f42d52093c1f41bc56e1e/qed/applique/gobbleup.rb
Do accelerators just boil down to finding a faster method like StringScanner#check_until
?
Honestly, I've ran into a design roadblock with accelerators - and have let it rest since then. The issue is that we want to support lazy evaluation across rule barriers - and that collides with acceleration.
The most potential for speeding up parsers I see in creating custom 'partial' parsers aka atom classes. But if you really need to go fast - don't use ruby. Simple as that.
All good to know, thanks for the response!
Welcome! (closing this)
https://github.com/kschiess/parslet/blob/9afeb3ca5ce7f83786f9a78cb5dca06a199b29f3/qed/accelerators.md#bindings-and-actions
Not sure if this is an oversight or just unfinished, but I couldn't find an example of how an accelerator can actually speed up parsing, e.g. an example implementation of
GobbleUp
. Will it always involve creating a customAtom
class?These would also be useful:
GobbleUp
appears to be a 1-to-1 substitution that doesn't make the parser substantially "dirtier")