The types of the file: top level, namespace bodies, top-level conditionals. */
| 988 | |
| 989 | /* The types of the file: top level, namespace bodies, top-level conditionals. */ |
| 990 | static void php_loose_walk(CBMExtractCtx *ctx, TSNode parent, int depth, |
| 991 | cbm_doclink_taken_fn taken) { |
| 992 | if (depth > PHP_COND_DEPTH) { |
| 993 | return; |
| 994 | } |
| 995 | TSTreeCursor cur = ts_tree_cursor_new(parent); |
| 996 | for (bool more = ts_tree_cursor_goto_first_child(&cur); more; |
| 997 | more = ts_tree_cursor_goto_next_sibling(&cur)) { |
| 998 | TSNode c = ts_tree_cursor_current_node(&cur); |
| 999 | if (php_is_type_decl(c)) { |
| 1000 | php_loose_type(ctx, c, taken); |
| 1001 | } else if (php_kind(c, "namespace_definition")) { |
| 1002 | TSNode body = ts_node_child_by_field_name(c, TS_FIELD("body")); |
| 1003 | if (!ts_node_is_null(body)) { |
| 1004 | php_loose_walk(ctx, body, depth + SKIP_ONE, taken); |
| 1005 | } |
| 1006 | } else if (php_is_branch(c)) { |
| 1007 | php_loose_walk(ctx, c, depth + SKIP_ONE, taken); |
| 1008 | } |
| 1009 | } |
| 1010 | ts_tree_cursor_delete(&cur); |
| 1011 | } |
| 1012 | |
| 1013 | void cbm_doclink_php_loose_docs(CBMExtractCtx *ctx, const CBMDefinition *file_def, |
| 1014 | cbm_doclink_taken_fn taken) { |
no test coverage detected