C/C++/CUDA/GLSL: parameters live on function_declarator inside declarator chain.
| 2987 | |
| 2988 | // C/C++/CUDA/GLSL: parameters live on function_declarator inside declarator chain. |
| 2989 | static TSNode find_c_params(TSNode func_node) { |
| 2990 | TSNode decl = ts_node_child_by_field_name(func_node, TS_FIELD("declarator")); |
| 2991 | for (int d = 0; d < C_RETURN_WALK_DEPTH && !ts_node_is_null(decl); d++) { |
| 2992 | TSNode params = ts_node_child_by_field_name(decl, TS_FIELD("parameters")); |
| 2993 | if (!ts_node_is_null(params)) { |
| 2994 | return params; |
| 2995 | } |
| 2996 | decl = ts_node_child_by_field_name(decl, TS_FIELD("declarator")); |
| 2997 | } |
| 2998 | TSNode null_node = {0}; |
| 2999 | return null_node; |
| 3000 | } |
| 3001 | |
| 3002 | // C++: resolve trailing return type (auto f() -> Type) on a declarator node. |
| 3003 | // Updates def->return_type and def->return_types if trailing type found. |