mainak55512 / JSONProcessor

Simple JSON query tool for JS
1 stars 0 forks source link

Allow arithmetic operation parsing in query string #1

Open mainak55512 opened 1 month ago

mainak55512 commented 1 month ago

This should parse something like (age * 2) <= 18

faresbouzayen commented 1 month ago

Hi @mainak55512,
I'd love to work on this! Should the parser support all arithmetic operations (e.g., +, -, *, /), or are there specific cases we should handle? Also, any guidance on how deeply nested expressions should be?
Looking forward to contributing!

mainak55512 commented 1 month ago

Hi @mainak55512,
I'd love to work on this! Should the parser support all arithmetic operations (e.g., +, -, *, /), or are there specific cases we should handle? Also, any guidance on how deeply nested expressions should be?
Looking forward to contributing!

Hi @faresbouzayen It should support all arithmetic operations (also should have a check for division by 0).

It is based on RD parser, so it should be able to recursively parse something like:

((a * 2) + b) * (c - (d % 4)) <= (e / f)