tree-sitter / tree-sitter/tree-sitter-cpp
Macro prevents correct parsing of class
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 453
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
An imported marco (I simplified the source file), prevented the correct parsing of the following class.
#include <GLFW/glfw3.h>
PXR_NAMESPACE_USING_DIRECTIVE
class Scene
{
};
I know that in the presence of macro a parser almost has no chance to understand C++, but I hope that this failure case may be useful for improving the parser.
translation_unit [3, 0] - [15, 0])
preproc_include [3, 0] - [6, 0])
path: system_lib_string [3, 9] - [3, 23])
declaration [6, 0] - [11, 2])
type: type_identifier [6, 0] - [6, 29])
ERROR [8, 0] - [8, 5])
identifier [8, 0] - [8, 5])
declarator: init_declarator [8, 6] - [11, 1])
declarator: identifier [8, 6] - [8, 11])
value: initializer_list [9, 0] - [11, 1])
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reduced C++ snippet in this issue and inspect how the parser handles PXR_NAMESPACE_USING_DIRECTIVE before the Scene class. Reproduce the shown syntax tree and determine whether the class is parsed correctly after the macro; done means the failure case no longer produces the reported ERROR node.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100