tree-sitter / tree-sitter/tree-sitter-cpp
Weird parsing results with nested template argument list
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 453
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
This example gives weird/inconsistent results leading me to believe there's an issue with parsing nested templates:
map<string, string> m;
map<string, vector<string>> m2;
map<string, vector<vector<string>>> v;
I expect to see all types highlighted, but the last line fails to highlight string in the first index to map; instead parsing it as an identifier when I expect type_identifier:

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
Reproduce the three nested-template declarations from the issue in the tree-sitter-cpp parser and inspect their parse or highlighting results. Trace how nested template arguments classify identifiers, then verify that every string in the example is highlighted as a type_identifier without regressing the simpler declarations.
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