We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priority brackets bug for complex binary operations in
odata.net/src/Microsoft.OData.Core/Uri/NodeToStringBuilder.cs
Line 91 in 6f5bc5e
I do not know how to reproduce it. The bug is in the internal class. So I do not understand how to implement test case for the fix?
Correct brackets for complex non-commutative operator expressions expression with same priority a-(b-c), a/(b/c)
In this case expression node a-(b-c) will be translated to a sub b sub c, but not to a sub (b sub c)
Would be cool if implement IsCommutative method for binary operators and use it to avoid redundant brackets for expressions like a+(b+c) or a*(b*c)
The text was updated successfully, but these errors were encountered:
This might be in the actual parsing or it may be in the string builder, it's unclear. Let's set up a repro and investigate.
Sorry, something went wrong.
I have created a small repo to repro this issue: https://github.com/WanjohiSammy/NodeToStringBuilderBracketsBugRepro
Still investigating.
WanjohiSammy
No branches or pull requests
Priority brackets bug for complex binary operations in
odata.net/src/Microsoft.OData.Core/Uri/NodeToStringBuilder.cs
Line 91 in 6f5bc5e
For right node we have not to use < (less) to compare operator priority, but <= (less or equals).
Reproduce steps
I do not know how to reproduce it. The bug is in the internal class. So I do not understand how to implement test case for the fix?
Expected result
Correct brackets for complex non-commutative operator expressions expression with same priority a-(b-c), a/(b/c)
Actual result
In this case expression node a-(b-c) will be translated to a sub b sub c, but not to a sub (b sub c)
Additional detail
Would be cool if implement IsCommutative method for binary operators and use it to avoid redundant brackets for expressions like a+(b+c) or a*(b*c)
The text was updated successfully, but these errors were encountered: