tree-sitter / tree-sitter-c

C grammar for tree-sitter
MIT License
237 stars 106 forks source link

Querying function paramter lists fails #93

Closed schirrmacher closed 5 months ago

schirrmacher commented 2 years ago

When querying for function parameter lists, I had the following issue:

static inline int some_function(struct slab *slab)
{
}

void __init some_other_function(void)
{
}

In this example only (struct slab *slab) is matched. I think the parser has problems with __init.

Is this intended behavior? Can I somehow extend the parser?

maxbrunsfeld commented 2 years ago

What is the query that you're using?

schirrmacher commented 2 years ago

I applied (function_definition _) @function and (function_declarator (parameter_list) @parameters)

schirrmacher commented 2 years ago

Screenshot 2022-02-23 at 16 58 21

amaanq commented 5 months ago

seems like this is fixed now