feat(expression): implement binary operation parser with support for …#103
feat(expression): implement binary operation parser with support for …#103LiYulin-s wants to merge 1 commit intoHejsil:masterfrom
Conversation
…prefix, postfix, and infix operators
Hejsil
left a comment
There was a problem hiding this comment.
I have not thoroughly read through all the code, so my understanding is a bit limited, but what are the benefits here compared to the examples/math.zig?
|
Compared to the |
Well, the math example doesn't avoid left recursion because the |
|
fine <3 |
|
Alright, had a look around and I'm not really convinced this is the way to go for |
I wrote a table driven parser for expressions, introducing
binaryOp, a utility for automatically generating expression parsers based on a table of operators, precedence, and associativity. It is heavily inspired by Parsec'sbuildExpressionParser.