tree-sitter / tree-sitter-c

C grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse tree misinterprets typedefs as function definitions when using extension keyword

nikitam95 opened this issue · comments

When parsing C code that uses the __extension__ keyword, the parse tree generated by Tree-sitter C language incorrectly treat typedef declarations as function definitions.

To Reproduce
Parse the following C code:

__extension__ typedef struct {  
  long long int quot;  
  long long int rem;  
} lldiv_t;  

Expected behavior
The parse tree should correctly recognize that this is a typedef declaration and not a function definition.

It's a gnu extension that we don't have added atm (__extension__ that is), feel free to PR support for it or I can in a bit