Preserve tokens within errors

This commit is contained in:
Max Brunsfeld 2015-06-15 15:24:15 -07:00
parent 0c4620f3ab
commit 3d0890eecf
9 changed files with 89 additions and 112 deletions

View file

@ -21,10 +21,10 @@ struct TSTree {
TSTreeOptions options;
TSLength padding;
TSLength size;
size_t child_count;
union {
struct {
struct TSTree **children;
size_t child_count;
size_t visible_child_count;
};
char lookahead_char;
@ -85,6 +85,10 @@ TSTree **ts_tree_children(const TSTree *tree, size_t *count);
TSTreeChild *ts_tree_visible_children(const TSTree *tree, size_t *count);
TSLength ts_tree_total_size(const TSTree *tree);
static inline bool ts_tree_is_empty(TSTree *tree) {
return ts_tree_total_size(tree).bytes == 0;
}
#ifdef __cplusplus
}
#endif