tree-sitter-c icon indicating copy to clipboard operation
tree-sitter-c copied to clipboard

C grammar for tree-sitter

Results 69 tree-sitter-c issues
Sort by recently updated
recently updated
newest added

```c #define TX_DESC_PER_IOCB 8 #define TX_DESC_PER_OAL ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2) ``` is parsed as follows, ```yaml translation_unit [0, 0] - [3, 0] preproc_def [0, 0] - [2, 0] name:...

`$ RUST_BACKTRACE=1 time tree-sitter highlight tree-sitter-c/src/parser.c` ```txt thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 12', cli/src/highlight.rs:359:34 stack backtrace: note: Some details...

```c #define FOO 1 /* this comment is not parsed as a comment */ #define BAR /* although this comment is */ ``` I found this while trying [emacs-tree-sitter](https://github.com/ubolonton/emacs-tree-sitter). Its...

bug

I'm looking to refactor some very old code and it would be useful to parse old-style (K&R) function definitions. For example: ```c int main(argc, argv) int argc; const char* argv[];...

the function `ntp_gettime` here is not recognized as function_definition: ``` (translation_unit (comment) (preproc_include path: (system_lib_string)) (preproc_ifdef name: (identifier) (preproc_def name: (identifier) value: (preproc_arg))) (declaration (storage_class_specifier) type: (primitive_type) declarator: (function_declarator declarator:...

Hey there does this grammar support the various c function definition syntax? When using c sitter plugins i get varying results and incomplete results when function definitions span multiple lines.

I'm trying to extract all the function_definition in C files but seems there's a false positive for 'function_definition' query. Minimal repro: ``` int foo(int a) { if (0) return 0;...

Currently, `__attribute__` is not parsed correctly when following or preceding a struct definition: ``` typedef struct { int x; } __attribute__((__packed__)) foo_t; translation_unit [0, 0] - [3, 0] type_definition [0,...

If you have code like the following: ```c #define TAKES_BLOCK(x, block) for (i = 0; i < x; i++) block int main(void) { { int x = 0; } TAKES_BLOCK(10,...

Please add support for `__restrict__` extension. Currently ms extension `__restrict` is supported, however using gnu `__restrict__` results in error. [GCC 7.2 Restricting Pointer Aliasing](https://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html)