LesterLyu / fast-formula-parser

Parse and evaluate MS Excel formula in javascript.
https://www.npmjs.com/package/fast-formula-parser
MIT License
454 stars 63 forks source link

Parsing some inputs that are invalid in Excel #27

Open danielgesua opened 3 years ago

danielgesua commented 3 years ago

Hi Lester,

I tried parsing "SUM((SUM(A2)-48):(SUM(A2)-48))" in your demo and got a valid answer (the sum of the 2nd row). However, while this works on your parser this would give a formula error in Excel.

Is this desirable behavior for your parser?

Best,

Daniel Gesua

LesterLyu commented 3 years ago

The grammar in the project is different from MS Excel, the current grammar does allow SUM((SUM(A2)-48):(SUM(A2)-48)). In the future release I may introduce a new way of checking the validity of some grammar.

danielgesua commented 3 years ago

Nice. Thank you for this project by the way. It really helped us along with ours.