2019-01-10 15:22:39 -08:00
|
|
|
#ifndef TREE_SITTER_TREE_CURSOR_H_
|
|
|
|
|
#define TREE_SITTER_TREE_CURSOR_H_
|
2018-05-09 16:38:56 -07:00
|
|
|
|
2019-01-04 17:33:34 -08:00
|
|
|
#include "./subtree.h"
|
2018-05-09 16:38:56 -07:00
|
|
|
|
|
|
|
|
typedef struct {
|
2018-05-11 15:06:13 -07:00
|
|
|
const Subtree *subtree;
|
2018-05-09 16:38:56 -07:00
|
|
|
Length position;
|
|
|
|
|
uint32_t child_index;
|
|
|
|
|
uint32_t structural_child_index;
|
|
|
|
|
} TreeCursorEntry;
|
|
|
|
|
|
2018-05-16 16:05:08 -07:00
|
|
|
typedef struct {
|
|
|
|
|
const TSTree *tree;
|
2018-11-07 15:11:21 -08:00
|
|
|
Array(TreeCursorEntry) stack;
|
2018-05-16 16:05:08 -07:00
|
|
|
} TreeCursor;
|
2018-05-09 16:38:56 -07:00
|
|
|
|
2018-06-21 12:54:04 -07:00
|
|
|
void ts_tree_cursor_init(TreeCursor *, TSNode);
|
2020-09-23 11:47:47 -07:00
|
|
|
void ts_tree_cursor_current_status(
|
|
|
|
|
const TSTreeCursor *,
|
|
|
|
|
TSFieldId *,
|
|
|
|
|
bool *,
|
|
|
|
|
bool *,
|
|
|
|
|
bool *,
|
|
|
|
|
TSSymbol *,
|
|
|
|
|
unsigned *
|
|
|
|
|
);
|
2018-05-09 16:38:56 -07:00
|
|
|
|
2019-01-10 15:22:39 -08:00
|
|
|
#endif // TREE_SITTER_TREE_CURSOR_H_
|