Count the short names of the top-level types and functions of kids[0, n) * and of braced namespace bodies among them. */
| 825 | /* Count the short names of the top-level types and functions of kids[0, n) |
| 826 | * and of braced namespace bodies among them. */ |
| 827 | static void php_count_names(php_walk_t *w, const TSNode *kids, int n) { |
| 828 | for (int i = 0; i < n; i++) { |
| 829 | TSNode c = kids[i]; |
| 830 | if (php_is_type_decl(c) || php_kind(c, "function_definition")) { |
| 831 | php_count_name(w, c); |
| 832 | } else if (php_kind(c, "if_statement")) { |
| 833 | php_cond_decls(w, c, 0, true); |
| 834 | } else if (php_kind(c, "namespace_definition")) { |
| 835 | TSNode body = ts_node_child_by_field_name(c, TS_FIELD("body")); |
| 836 | int bn = 0; |
| 837 | TSNode *bk = ts_node_is_null(body) ? NULL : php_children(w, body, &bn); |
| 838 | php_count_names(w, bk, bn); |
| 839 | } |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | static void php_namespace_rec(php_walk_t *w, TSNode def, uint32_t first, uint32_t last) { |
| 844 | TSNode name = ts_node_child_by_field_name(def, TS_FIELD("name")); |
no test coverage detected