Add function for retrieving a leaf node by position

This commit is contained in:
Max Brunsfeld 2014-07-18 18:52:08 -07:00
parent 1ecafb874e
commit 466daeaf99
5 changed files with 58 additions and 17 deletions

View file

@ -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