Discard tokens after error detection to find the best repair
* Use GLR stack-splitting to try all numbers of tokens to discard until a repair is found. * Check the validity of repairs by looking at the child trees, rather than the statically-computed 'in-progress symbols' list
This commit is contained in:
parent
9d247e45b2
commit
22c550c9d6
21 changed files with 454 additions and 506 deletions
|
|
@ -53,7 +53,7 @@ vector<StackEntry> get_stack_entries(Stack *stack, StackVersion version) {
|
|||
ts_stack_iterate(
|
||||
stack,
|
||||
version,
|
||||
[](void *payload, TSStateId state, size_t tree_count, bool is_done, bool is_pending) -> StackIterateAction {
|
||||
[](void *payload, TSStateId state, TreeArray *trees, size_t tree_count, bool is_done, bool is_pending) -> StackIterateAction {
|
||||
auto entries = static_cast<vector<StackEntry> *>(payload);
|
||||
StackEntry entry = {state, tree_count};
|
||||
if (find(entries->begin(), entries->end(), entry) == entries->end())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue