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
I have read all the tree-sitter docs if it relates to using the parser
I have searched the existing issues of tree-sitter-c
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
No response
Describe the bug
C style casting has very high precedence and incorrectly parse expression a < (b) && c > d.
(b) is parsed to be a type-specifier, && has been parsed to two consecutive pointer-expressions, so the expression becomes
(a) < ((b)&&c) > d.
However, in C/C++, taking the address of a variable twice is not possible, so this parse result is definitely wrong (no ambiguity) in this case.
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
C style casting has very high precedence and incorrectly parse expression a < (b) && c > d.
(b) is parsed to be a type-specifier, && has been parsed to two consecutive pointer-expressions, so the expression becomes
(a) < ((b)&&c) > d.
However, in C/C++, taking the address of a variable twice is not possible, so this parse result is definitely wrong (no ambiguity) in this case.
Steps To Reproduce/Bad Parse Tree
See the "Repro" program.
Expected Behavior/Parse Tree
Repro
The text was updated successfully, but these errors were encountered: