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 understand it won't be possible to handle macros correctly in every case, but it seems like it should be possible to determine that the last node is still a class specifier and not a function definition. Removing either the AttributeMacro or the ClassDeclarationMacro, causes it to be parsed correctly again.
Expected Behavior/Parse Tree
It's fine if these nodes result in parsing errors, but ideally they should still allow the rest of the class declaration to be parsed:
lsp-ableton
changed the title
bug: __attribute__ keyword not parsed correctly in class declaration
bug: class specifier parsed as function definition
Nov 11, 2024
Having this exact issue as well. I get that macros are hard. I don't really care about the macro, but I want to correctly get the class name and the scope of its definition.
Curious if there is some workaround or if this is just fundamentally impossible given the architecture of tree-sitter.
Uh oh!
There was an error while loading. Please reload this page.
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)tree-sitter 0.23.0
Describe the bug
tree-sitter-cpp
does not correctly parse macros in a class declaration, causing the class to be misinterpreted as a function definition.Steps To Reproduce/Bad Parse Tree
The following results in a parse error:
I understand it won't be possible to handle macros correctly in every case, but it seems like it should be possible to determine that the last node is still a class specifier and not a function definition. Removing either the
AttributeMacro
or theClassDeclarationMacro
, causes it to be parsed correctly again.Expected Behavior/Parse Tree
It's fine if these nodes result in parsing errors, but ideally they should still allow the rest of the class declaration to be parsed:
Repro
The text was updated successfully, but these errors were encountered: