tree-sitter-c
tree-sitter-c copied to clipboard
C grammar for tree-sitter
The following code does not parse correctly, or recover gracefully: ``` void haunted() { { DEBUG_CODE( if (0) { a(1); } ); } } ``` On the playground, this produces...
I tried to construct a query that would match a function_definition with a capture for the identifier, but I wasn't able to make a one that would reliably match the...
While looking into how one could tackle zeek/tree-sitter-zeek#6 I looked into this grammar for inspiration and noticed that it has similar issues. In C or C++ preprocessor macros can appear...
It is possible (and necessary) to declare a custom defined variable by enclosing the result in parenthesis. For example: ```c typedef double CeedScalar; void example(CeedScalar in[]) { const CeedScalar (*q)...
Hi, in the C language there is an ambiguity with the syntax `T(a);`: 1) if `T` is a type, this is a variable declaration 2) else, it is a function...
I would like to highlight builtin types differently from user defined types. Like `int` type here: But tree-sitter-c will highlight to a Normal type. PS: std::vector is highlight by lsp...
 This occurs in both C/C++. Captured in Neovim v0.7.0 using nvim-treesitter.
Related: https://github.com/tree-sitter/tree-sitter/pull/1749
Using the following in the playground leads to an inaccurate parse: ```c int f(void) { return a *= b != c ? d : e; } ``` This parses as...
Hi, I've received [this](https://github.com/m-demare/hlargs.nvim/issues/21) issue in my neovim plugin Basically, when a macro is used in the parameter_list, the parser fails:  Is this solvable?