Remove the concept of fragile reductions

They were a vestige of when Tree-sitter did sentential form-based
incremental parsing (as opposed to simply state matching). This was
elegant but not compatible with GLR as far as I could tell.
This commit is contained in:
Max Brunsfeld 2018-03-02 14:51:54 -08:00
parent 07fa3eb386
commit 52087de4f0
7 changed files with 20 additions and 66 deletions

View file

@ -1119,11 +1119,12 @@ static void parser__advance(Parser *self, StackVersion version, ReusableNode *re
}
case TSParseActionTypeReduce: {
bool is_fragile = table_entry.action_count > 1;
LOG("reduce sym:%s, child_count:%u", SYM_NAME(action.params.symbol), action.params.child_count);
StackPopResult reduction = parser__reduce(
self, version, action.params.symbol, action.params.child_count,
action.params.dynamic_precedence, action.params.alias_sequence_id,
action.params.fragile
is_fragile
);
StackSlice slice = *array_front(&reduction.slices);
last_reduction_version = slice.version;