Refactor parser and stack
This commit is contained in:
parent
1e79ed794b
commit
4327f3ed26
7 changed files with 108 additions and 183 deletions
|
|
@ -26,10 +26,12 @@ void ts_document_free(TSDocument *document) {
|
|||
|
||||
static void reparse(TSDocument *document, TSInputEdit *edit) {
|
||||
if (document->input.read_fn && document->parser.language) {
|
||||
const TSTree *tree = ts_parser_parse(&document->parser, document->input, edit);
|
||||
const TSTree *tree =
|
||||
ts_parser_parse(&document->parser, document->input, edit);
|
||||
if (document->node)
|
||||
ts_node_release(document->node);
|
||||
document->node = ts_node_make_root(tree, document->parser.language->symbol_names);
|
||||
document->node =
|
||||
ts_node_make_root(tree, document->parser.language->symbol_names);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue