tree-sitter-cpp
tree-sitter-cpp copied to clipboard
C++ grammar for tree-sitter
Hi, We are using a few libraries with C++ macros, which cause some parsing troubles with treesitter. Here are a few examples. 1. [Abseil flags library](https://abseil.io/docs/cpp/guides/flags): Example: ```c++ ABSL_FLAG(int, a);...
I am trying to parse the following two codes, but I got different results. ``` #define DHTPIN 27 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); ``` The result for the above...
The following is the code I'm using: ```C++ class Dummy { public: int foo(); int bar(int val); }; class DummyTwo; ``` ``` translation_unit [0, 0] - [7, 0] class_specifier [0,...
It adds unnecessary C++ dependency for the runtime. Since Tree-Sitter strives to be pure C runtime, it's a setback for using this grammar. For example, **tree-sitter-c** doesn't require C++ compiler/libstd...
https://en.cppreference.com/w/cpp/language/friend the keyword "friend" is mistaken as a type_identifier for template functions. example: ```cpp template friend H AbslHashValue(H h, const RequestKey& key) {} ``` ``` translation_unit [1, 0] - [3,...
failed to parse the following code: ```cpp inline constexpr vk::SparseMemoryBindFlags operator|(vk::SparseMemoryBindFlagBits bit0, vk::SparseMemoryBindFlagBits bit1) noexcept __attribute__((always_inline)) { } ``` the current parser doesn't allow noexcept followed by __attribute__ ``` translation_unit...
sizeof is not highlighted correctly
No information is provided about the ellipsis in the AST. ```c extern void eggx_gsetinitialparsegeometry( const char *, ... ) ; ``` AST is: ``` (translation_unit 1 1 64 (declaration 1...
testcase: ``` void (Class::*member_function_ptr)(int); ``` tree-sitter output: ``` declaration [0, 0] - [0, 40]) type: primitive_type [0, 0] - [0, 4]) declarator: function_declarator [0, 5] - [0, 39]) declarator: parenthesized_declarator...
Source code: ```cpp template class A {}; class B { template friend class A; }; ``` nvim-treesitter info: ``` template_declaration [0, 0] - [0, 33] parameters: template_parameter_list [0, 9] -...