Support nested arithmetic expressions
tomharmon opened this issue · comments
As mentioned in the comments of arithmetic.rs
, operator precedence is not currently supported and neither is nested arithmetic expressions.
I plan on eventually submitting a PR to support this but first wanted to open an issue so others may be aware of what I am working on in case they want to also contribute.
I have minimal experience with parsers, but after some research found that Pratt parsers are probably best for this purpose, and plan to implement it using this approach barring any comments/suggestions from other contributors
After looking at the codebase a little more I noticed that ArithmeticExpression
s are used in ConditionTree
s. I also found an example arithmetic expression parser in the nom
codebase that parses expressions into ASTs. I'm thinking that implementing something very similar to the example from nom
is what we want. let me know any thoughts