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-cpp
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
No response
Describe the bug
Using tree-sitter-cpp to validate all functions in my repository have comments. One of the macros, causes the comments to be swallowed
Steps To Reproduce/Bad Parse Tree
In my script I find all function_declarator and iterate through the prev_sibling collecting all immidiate nodes of type comment. The macro INLINE causes the constructor to be considered declaration and thus it swallowed the comments before the destructor.
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
Using
tree-sitter-cpp
to validate all functions in my repository have comments. One of the macros, causes the comments to be swallowedSteps To Reproduce/Bad Parse Tree
In my script I find all
function_declarator
and iterate through theprev_sibling
collecting all immidiate nodes of typecomment
. The macroINLINE
causes the constructor to be considereddeclaration
and thus it swallowed the comments before the destructor.declaration b'INLINE CWibbling3DExplosion::CWibbling3DExplosion(\n\t\tconst CVector * a2,\n\t\tchar * a3,\n\t\ti32 a4,\n\t\ti32 a5,\n\t\ ti32 a6,\n\t\ti32 a7,\n\t\ti32 a8,\n\t\ti32 a9,\n\t\ti32 a10,\n\t\ti32 a11,\n\t\ti32 a12)\n\t: C3DExplosion(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)\n{\n\tgWibblingExpCount++;\n}\n\n// @Ok\n// @Matching'
Expected Behavior/Parse Tree
Comments not be inside the
declaration
node.Repro
The text was updated successfully, but these errors were encountered: