| 292 | } |
| 293 | |
| 294 | static bool occurrence_parent(TSTreeCursor *cursor, TSNode current, TSNode *parent, |
| 295 | const char **field) { |
| 296 | if (cursor) { |
| 297 | *field = ts_tree_cursor_current_field_name(cursor); |
| 298 | usage_field_lookup_test_note_work(); |
| 299 | if (!ts_tree_cursor_goto_parent(cursor)) { |
| 300 | *parent = (TSNode){0}; |
| 301 | return false; |
| 302 | } |
| 303 | *parent = ts_tree_cursor_current_node(cursor); |
| 304 | return true; |
| 305 | } |
| 306 | |
| 307 | *parent = ts_node_parent(current); |
| 308 | if (ts_node_is_null(*parent)) { |
| 309 | *field = NULL; |
| 310 | return false; |
| 311 | } |
| 312 | *field = field_name_for_node(*parent, current); |
| 313 | return true; |
| 314 | } |
| 315 | |
| 316 | static const char *field_name_for_walk_node(WalkState *state, TSNode parent, TSNode node) { |
| 317 | if (state && state->current_cursor && |
no test coverage detected