bug: namespace_definition and attributes issue
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp, javascript
- Domain
- compilers
Research direction
The namespace_definition rule lives in grammar.js, so start there and check where attribute_specifier is already allowed in neighbouring rules. Add optional attribute specifiers before and after the name, regenerate the parser, and confirm both repro snippets in the issue parse without ERROR nodes. Done means a corpus test in test/corpus covering both placements passes with tree-sitter test.
Written by the indexing model from the issue text.
Description
Did you check existing issues?
- 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)
0.27.0
Describe the bug
namespace_definition symbol should be completed with optional($.attribute_specifier) before and after name field.
Steps To Reproduce/Bad Parse Tree
try to put legal c++ namespace definition to namespace __attribute__ (( __visibility__ ( default ))) ns {} to standard playground and you will get syntax error. The attribute specifier should be optionally accepted before and after name. This code copy-pasted from linux std include dir.
Expected Behavior/Parse Tree
no error
Repro
namespace __attribute__ (( __visibility__ ( default ))) ns {} // Code that causes a parse error
namespace ns __attribute__ (( __visibility__ ( default ))) {} // Code that causes a parse error too
}
- Dominant language
- JavaScript
- Stars
- 459
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from tree-sitter/tree-sitter-cpp
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tree-sitter/tree-sitter-cpp#374 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
tree-sitter/tree-sitter-cpp#371 · 1 comment ·
-
`tree_sitter_cpp_external_scanner_deserialize` doesn't bound `length` against the size of the delimiter bufferPossibly taken @dekobon claimed this 74 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
tree-sitter/tree-sitter-cpp#368 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
tree-sitter/tree-sitter-cpp#365 · 1 reaction ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
tree-sitter/tree-sitter-cpp#363 ·
All issues in tree-sitter/tree-sitter-cpp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/rocketmq-dashboard#6896 ·
Maintainers usually reply within 3 days
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
[workshop-sync] workshop/side-quest-17-06-output-injection.md: stale add_comment.cjs line referencesOpendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
githubnext/gh-aw-workshop#4679 ·
Maintainers usually reply within 1 day
-
bug engine
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
frostney/GocciaScript#1746 ·
Maintainers usually reply within 1 day
-
Add: AVA MediaOpenchannels:add check:failed
Difficulty 2/5 1-3 hours Newbie friendliness 63/100