Add function for retrieving a leaf node by position
This commit is contained in:
parent
1ecafb874e
commit
466daeaf99
5 changed files with 58 additions and 17 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define RUNTIME_NODE_H_
|
||||
|
||||
#include "tree_sitter/parser.h"
|
||||
#include "runtime/tree.h"
|
||||
|
||||
struct TSNode {
|
||||
size_t ref_count;
|
||||
|
|
@ -9,10 +10,10 @@ struct TSNode {
|
|||
size_t index;
|
||||
const TSTree *content;
|
||||
struct TSNode *parent;
|
||||
TSParserConfig *config;
|
||||
const char **names;
|
||||
};
|
||||
|
||||
TSNode * ts_node_make(const TSTree *tree, TSNode *parent, size_t index, size_t start_position, TSParserConfig *config);
|
||||
TSNode * ts_node_make_root(const TSTree *tree, TSParserConfig *config);
|
||||
TSNode * ts_node_make(const TSTree *tree, TSNode *parent, size_t index, size_t start_position, const char **names);
|
||||
TSNode * ts_node_make_root(const TSTree *tree, const char **names);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue