Pass edit information into parser function
This commit is contained in:
parent
464a0e8dad
commit
0d6435e24a
6 changed files with 35 additions and 24 deletions
|
|
@ -30,12 +30,11 @@ const char * ts_document_string(const ts_document *document) {
|
|||
|
||||
void ts_document_set_input(ts_document *document, ts_input input) {
|
||||
document->input = input;
|
||||
document->tree = ts_parser_parse(&document->parser, input);
|
||||
document->tree = ts_parser_parse(&document->parser, input, NULL);
|
||||
}
|
||||
|
||||
void ts_document_edit(ts_document *document, size_t position, size_t bytes_removed, size_t bytes_inserted) {
|
||||
document->input.seek_fn(document->input.data, 0);
|
||||
document->tree = ts_parser_parse(&document->parser, document->input);
|
||||
void ts_document_edit(ts_document *document, ts_input_edit edit) {
|
||||
document->tree = ts_parser_parse(&document->parser, document->input, &edit);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue