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
Normally when you create a calculator you work merely with binary operations and everything is parenthesized internally like so (unless they transform it like I think I will be doing to solve this):
a + (b + c)
Now, Lark is thinking this is what we always want. When I try to match a finite number of additions, greater than two:
["Add", ["a", "b", "c", "d"]] inside the last part, but instead it thinks the user means (a + b) + (c + d).
Now I have a user code solution to this: Convert to the format I want in the addition() transformer method. It checks if either side is addition and if so, blends everything together.
However, a Lark-side solution would be much cleaner code. Or am I doing something incorrect, and this is NOT a bug?
The text was updated successfully, but these errors were encountered:
Describe the bug
Normally when you create a calculator you work merely with binary operations and everything is parenthesized internally like so (unless they transform it like I think I will be doing to solve this):
a + (b + c)
Now, Lark is thinking this is what we always want. When I try to match a finite number of additions, greater than two:
I use:
I.e. the most obvious / simple way to accomplish the above. However:
So, what I would expect to see is:
["Add", ["a", "b", "c", "d"]] inside the last part, but instead it thinks the user means (a + b) + (c + d).
Now I have a user code solution to this: Convert to the format I want in the addition() transformer method. It checks if either side is addition and if so, blends everything together.
However, a Lark-side solution would be much cleaner code. Or am I doing something incorrect, and this is NOT a bug?
The text was updated successfully, but these errors were encountered: