You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now when an expression like 2 + 3 + 4 + 5 is passed to the parse function, it's broken down into 'Binary expressions' & the tree generated is binary one & looks like what it'd be for (2 + 3) + (4 + 5):
I know these are equivalent, but just to avoid extra parentheses when we try to rebuild the expression from the tree or when we try to show these in a tree form a bit better, could we generate the same thing as a 'list like' expression type where we could just show a n-ary tree instead of binary ('left' and 'right') one:
We can't do this by default, because our output needs to be compatible with other parsers, but it could easily be an optional plugin. It doesn't even need to modify the parser, it can just be an AST transformation (that's how we do it in Mavo that uses JSEP and also needs this).
Right now when an expression like
2 + 3 + 4 + 5
is passed to the parse function, it's broken down into 'Binary expressions' & the tree generated is binary one & looks like what it'd be for(2 + 3) + (4 + 5)
:I know these are equivalent, but just to avoid extra parentheses when we try to rebuild the expression from the tree or when we try to show these in a tree form a bit better, could we generate the same thing as a 'list like' expression type where we could just show a n-ary tree instead of binary ('left' and 'right') one:
If nothing, could we write plugin which'd do the same thing?
The text was updated successfully, but these errors were encountered: