Allow multiple parse actions in parse table
This commit is contained in:
parent
25f8ecd85f
commit
755894b44d
7 changed files with 46265 additions and 46256 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue