ms705 / nom-sql

Rust SQL parser written using nom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 ArithmeticExpressions are used in ConditionTrees. 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