Allow multiple parse actions in parse table

This commit is contained in:
Max Brunsfeld 2015-05-19 10:46:01 -07:00
parent 25f8ecd85f
commit 755894b44d
7 changed files with 46265 additions and 46256 deletions

View file

@ -27,9 +27,14 @@
* Private
*/
static const TSParseAction ERROR_ACTION = {
.type = TSParseActionTypeError
};
static TSParseAction get_action(const TSLanguage *language, TSStateId state,
TSSymbol sym) {
return (language->parse_table + (state * language->symbol_count))[sym];
const TSParseAction *actions = (language->parse_table + (state * language->symbol_count))[sym];
return actions ? actions[0] : ERROR_ACTION;
}
static TSLength break_down_left_stack(TSParser *parser, TSInputEdit edit) {