Always resolve ambiguities immediately

No more ambiguity nodes.
Also, when merging parse stacks, merge their successors if needed.
This commit is contained in:
Max Brunsfeld 2015-07-15 09:21:53 -07:00
parent 8c5c695f5a
commit 0b1d70db34
18 changed files with 123 additions and 86 deletions

View file

@ -303,9 +303,13 @@ static TSTree *finish(TSParser *parser) {
* Public
*/
TSTree * ts_parser_select_tree(void *data, TSTree *left, TSTree *right) {
return left;
}
TSParser ts_parser_make() {
return (TSParser) { .lexer = ts_lexer_make(),
.stack = ts_parse_stack_new(),
.stack = ts_parse_stack_new((TreeSelectionCallback) {NULL, ts_parser_select_tree}),
.right_stack = ts_stack_make() };
}