[Feature Request] Pratt Parsing combinators
stefnotch opened this issue · 2 comments
stefnotch commented
Implementing pratt parsing (or precedence climbing, which is supposedly the same algorithm) could be useful. I quite like it for parsing mathematical expressions with lots of different operators, since I no longer has to bend my parsing rules to fit, and can instead specify the binding power and associativity.
There are other libraries that have implemented this, for example
- https://github.com/kevinmehall/rust-peg#comparison-with-similar-parser-generators
- rust analyzer https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html
- chumsky has an experimental one
stefnotch commented
Thanks, then I'll close this one