Skip to content

Support for additional parentheses #9

@pavelicious-dev

Description

@pavelicious-dev

Hi there!

Evaluating this formula (-0.02*(1+5+3+1+5+3+1))+(0.07*(3+5+3+3+3+1+3+0))+(0.15*(3+1+5+1+5+3+1))-4.36
will fail with the following error:

Error: operation must be string, but get {"left":{"left":{"left":{"left":{"left":{"left":"1","right":"5","operation":"+"},"right":"3","operation":"+"},"right":"1","operation":"+"},"right":"5","operation":"+"},"right":"3","operation":"+"},"right":"1","operation":"+","grouped":true}

The reason seems to be the additional / unnecessary parentheses if I'm not mistaken;
evaluating it like this: -0.02*(1+5+3+1+5+3+1)+0.07*(3+5+3+3+3+1+3+0)+0.15*(3+1+5+1+5+3+1)-4.36 works fine.

Sometimes additional parentheses are useful for clarity, especially for our team members working with large json files. Ideally this should not throw errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions