Simplify ts_language_has_actions so it allows non-terminals

Fixes #933
This commit is contained in:
Max Brunsfeld 2021-02-26 14:52:41 -08:00
parent d56f9ebe4e
commit e710a14244

View file

@ -54,16 +54,6 @@ static inline const TSParseAction *ts_language_actions(
return entry.actions;
}
static inline bool ts_language_has_actions(
const TSLanguage *self,
TSStateId state,
TSSymbol symbol
) {
TableEntry entry;
ts_language_table_entry(self, state, symbol, &entry);
return entry.action_count > 0;
}
static inline bool ts_language_has_reduce_action(
const TSLanguage *self,
TSStateId state,
@ -103,6 +93,14 @@ static inline uint16_t ts_language_lookup(
}
}
static inline bool ts_language_has_actions(
const TSLanguage *self,
TSStateId state,
TSSymbol symbol
) {
return ts_language_lookup(self, state, symbol) != 0;
}
// Iterate over all of the symbols that are valid in the given state.
//
// For 'large' parse states, this just requires iterating through