Expose lower stack nodes via pop_until() function

This callback-based API allows the parser to easily visit each interior node
of the stack when searching for an error repair. It also is a better abstraction
over the stack's DAG implementation than having the public functions for
accessing entries and their successor entries.
This commit is contained in:
Max Brunsfeld 2016-03-07 16:03:23 -08:00
parent bc8df9f5c5
commit 4348eb89d4
9 changed files with 417 additions and 295 deletions

View file

@ -45,10 +45,10 @@ TreeArray ts_tree_array_copy(TreeArray *self) {
return result;
}
void ts_tree_array_clear(TreeArray *self) {
void ts_tree_array_delete(TreeArray *self) {
for (size_t i = 0; i < self->size; i++)
ts_tree_release(self->contents[i]);
array_clear(self);
array_delete(self);
}
TSTree *ts_tree_make_error(TSLength size, TSLength padding, char lookahead_char) {