Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently tree-sitter-cpp uses
attribute_declaration
from the C parser. Since the grammar for attributes is different between C and C++, this is not sufficient.Namely C++ allows using
using
in attributes, ie:Consequently tree-sitter-cpp currently errors with the above code. This patch fixes that.
Additionally this patch also implements attributed using-directives such as:
Currently, using-directives are parsed as
using_declaration
, consequently it now also accepts invalid using-declarations such as[[deprecated]] using typename foo;
and invalid using-enum-declarations such as[[deprecated]] using enum foo;
.Please advise if pulling using-directives into their own
using_directive
node type is okay - that'd be more correct and alleviate this issue.