You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 name of a defined function regardless of it's return type (mostly to do with the way pointers are handled, #14)
Without the ability to recursively match an arbitrary number of pointer_declarators I don't see how one could use the query language for any useful purpose with this grammar.
The text was updated successfully, but these errors were encountered:
I have started playing with tree-sitter for a short time and am trying to parse function declarations; however, I have not found a way to parse the function's return type. Therefore, the query I have constructed at the moment is:
(function_declarator) @func
But it lacks the part of the return type, which I don't know how to fix yet. I don't think there should be a special case if the return type is a pointer or any other type. I guess the type_identifier rule would be the one that will help us. Still, I may be wrong since I am entirely new to tree-sitter queries.
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 name of a defined function regardless of it's return type (mostly to do with the way pointers are handled, #14)
The code to query
The query
The resulting tree structure is something like
Without the ability to recursively match an arbitrary number of pointer_declarators I don't see how one could use the query language for any useful purpose with this grammar.
The text was updated successfully, but these errors were encountered: