Rename node accessor methods
Instead of child() vs concrete_child(), next_sibling() vs next_concrete_sibling(), etc, the default is switched: child() refers to the concrete syntax tree, and named_child() refers to the AST. Because the AST is abstract through exclusion of some nodes, the names are clearer if the qualifier goes on the AST operations
This commit is contained in:
parent
245daffbc4
commit
7ee5eaa16a
16 changed files with 475 additions and 476 deletions
|
|
@ -18,8 +18,8 @@ typedef unsigned short TSStateId;
|
|||
|
||||
typedef enum {
|
||||
TSNodeTypeHidden,
|
||||
TSNodeTypeConcrete,
|
||||
TSNodeTypeNormal,
|
||||
TSNodeTypeAnonymous,
|
||||
TSNodeTypeNamed,
|
||||
} TSNodeType;
|
||||
|
||||
typedef struct TSLexer {
|
||||
|
|
|
|||
|
|
@ -48,24 +48,22 @@ typedef struct TSDocument TSDocument;
|
|||
|
||||
TSLength ts_node_pos(TSNode);
|
||||
TSLength ts_node_size(TSNode);
|
||||
TSSymbol ts_node_sym(TSNode);
|
||||
TSNode ts_node_child(TSNode, size_t);
|
||||
size_t ts_node_child_count(TSNode);
|
||||
TSNode ts_node_concrete_child(TSNode, size_t);
|
||||
size_t ts_node_concrete_child_count(TSNode);
|
||||
TSNode ts_node_find_for_pos(TSNode, size_t);
|
||||
TSNode ts_node_find_for_range(TSNode, size_t, size_t);
|
||||
TSNode ts_node_find_concrete_for_pos(TSNode, size_t);
|
||||
TSNode ts_node_find_concrete_for_range(TSNode, size_t, size_t);
|
||||
TSNode ts_node_parent(TSNode);
|
||||
TSNode ts_node_next_sibling(TSNode);
|
||||
TSNode ts_node_prev_sibling(TSNode);
|
||||
TSNode ts_node_next_concrete_sibling(TSNode);
|
||||
TSNode ts_node_prev_concrete_sibling(TSNode);
|
||||
TSSymbol ts_node_symbol(TSNode);
|
||||
const char *ts_node_name(TSNode, const TSDocument *);
|
||||
const char *ts_node_string(TSNode, const TSDocument *);
|
||||
bool ts_node_eq(TSNode, TSNode);
|
||||
bool ts_node_is_concrete(TSNode);
|
||||
bool ts_node_is_named(TSNode);
|
||||
TSNode ts_node_parent(TSNode);
|
||||
TSNode ts_node_child(TSNode, size_t);
|
||||
TSNode ts_node_named_child(TSNode, size_t);
|
||||
size_t ts_node_child_count(TSNode);
|
||||
size_t ts_node_named_child_count(TSNode);
|
||||
TSNode ts_node_next_sibling(TSNode);
|
||||
TSNode ts_node_next_named_sibling(TSNode);
|
||||
TSNode ts_node_prev_sibling(TSNode);
|
||||
TSNode ts_node_prev_named_sibling(TSNode);
|
||||
TSNode ts_node_descendent_for_range(TSNode, size_t, size_t);
|
||||
TSNode ts_node_named_descendent_for_range(TSNode, size_t, size_t);
|
||||
|
||||
TSDocument *ts_document_make();
|
||||
void ts_document_free(TSDocument *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue