[X] I have read all the tree-sitter docs if it relates to using the parser
[X] I have searched the existing issues of tree-sitter-c
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
tree-sitter 0.21.1
Describe the bug
There appears to be a bug related to the query for parsing else clauses in tree-sitter. When using the following query to parse the provided code snippet, a TSQueryErrorStructure error occurs.
The query works correctly in the Syntax Tree Playground, suggesting that the issue might be specific to the TypeScript implementation or usage of the tree-sitter library.
This issue arises when trying to ensure compliance with a rule that mandates specific handling of else clauses.
Steps To Reproduce/Bad Parse Tree
Use the provided query in a TypeScript environment with tree-sitter for C.
Parse the given code snippet.
Observe the Query error of type TSQueryErrorNodeType error.
Expected Behavior/Parse Tree
The query should correctly identify the else_clause without any errors, as it does in the Syntax Tree Playground.
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)tree-sitter 0.21.1
Describe the bug
There appears to be a bug related to the query for parsing else clauses in tree-sitter. When using the following query to parse the provided code snippet, a TSQueryErrorStructure error occurs.
The query works correctly in the Syntax Tree Playground, suggesting that the issue might be specific to the TypeScript implementation or usage of the tree-sitter library.
This issue arises when trying to ensure compliance with a rule that mandates specific handling of else clauses.
Steps To Reproduce/Bad Parse Tree
Query error of type TSQueryErrorNodeType
error.Expected Behavior/Parse Tree
The query should correctly identify the else_clause without any errors, as it does in the Syntax Tree Playground.
Repro
Query
Code Snippet
Typescript