Refactor parser and stack

This commit is contained in:
Max Brunsfeld 2014-08-09 01:03:55 -07:00
parent 1e79ed794b
commit 4327f3ed26
7 changed files with 108 additions and 183 deletions

View file

@ -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);
}
}