tree-sitter-cpp
tree-sitter-cpp copied to clipboard
C++ grammar for tree-sitter
Example: ```cpp void test(int a) { // tree-sitter output is // expression_statement [1, 3] - [1, 10]) // compound_literal_expression [1, 3] - [1, 9]) // type: type_identifier [1, 3] -...
Testcase: ``` A::A() = default; ``` This is an ambiguous case (expression vs the constructor decl) -- from the log, tree-sitter actually parsed both, but in the final stage it...
An imported marco (I simplified the source file), prevented the correct parsing of the following class. ```cpp #include PXR_NAMESPACE_USING_DIRECTIVE class Scene { }; ``` I know that in the presence...
I used to do `set syntax=cpp.doxygen` in vim which would give me nice highlighting for doxygen documentation comments, but with Treesitter this doesn't work anymore. Would it be possible in...
The tree-sitter parser makes no distinction between a function declaration and this constructor call. It even thinks that `x` or `n` in my example are types. So this is probably...
The following is the C++ code I am using: ```C++ int a = (x->y < u && z >= w); ``` I am expecting several binary operations for the comparison,...
Please add support for `__restrict__` extension. - restrict is not a valid C++ keyword, though many code-bases do `#define restrict __restrict__` - ms extension `__restrict` is currently supported - gcc/clang...
https://en.cppreference.com/w/cpp/language/alignas Example: ``` class alignas(uintptr_t) JitScript final : public TrailingArray { } ```
`a = 0b001101` and `a = 0x3fff` are parsed appropriately with the binary and hexadecimal showing up as a numeric literal. However, `a = 0B001101` and `a = 0X3FFF` will...
I am experimenting with using tree-sitter for reformatting C++ I wrote a python script (couldn't make it work in C++) that takes the syntax tree generated by tree-sitter and uses...