Start using the forward move to recover from errors

Some unit tests passing. Corpus tests still failing
This commit is contained in:
Max Brunsfeld 2016-03-02 21:03:55 -08:00
parent b733b0cc81
commit aef7582a2a
8 changed files with 295 additions and 113 deletions

View file

@ -191,6 +191,19 @@ describe("Stack", [&]() {
free_pop_results(&results);
});
it("stops immediately when removing an error", [&]() {
trees[2]->symbol = ts_builtin_sym_error;
StackPopResultArray results = ts_stack_pop(stack, 0, 2, false);
AssertThat(results.size, Equals<size_t>(1));
StackPopResult result = results.contents[0];
AssertThat(result.trees, Equals(vector<TSTree *>({ trees[2] })));
AssertThat(ts_stack_top_state(stack, 0), Equals(stateB));
free_pop_results(&results);
});
});
describe("splitting the stack", [&]() {