Avoid duplicate error state entries for tokens that are both internal & external
This commit is contained in:
parent
2721f72c41
commit
91456d7a17
2 changed files with 7 additions and 6 deletions
|
|
@ -161,7 +161,9 @@ class ParseTableBuilderImpl : public ParseTableBuilder {
|
|||
}
|
||||
|
||||
for (size_t i = 0; i < grammar.external_tokens.size(); i++) {
|
||||
parse_table.states[state_id].terminal_entries[Symbol::external(i)].actions.push_back(ParseAction::Recover());
|
||||
if (grammar.external_tokens[i].corresponding_internal_token == rules::NONE()) {
|
||||
parse_table.states[state_id].terminal_entries[Symbol::external(i)].actions.push_back(ParseAction::Recover());
|
||||
}
|
||||
}
|
||||
|
||||
parse_table.add_terminal_action(state_id, END_OF_INPUT(), ParseAction::Recover());
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
parser__log(self); \
|
||||
} \
|
||||
|
||||
#define LOG_STACK() \
|
||||
if (self->print_debugging_graphs) { \
|
||||
ts_stack_print_dot_graph(self->stack, self->language->symbol_names, \
|
||||
stderr); \
|
||||
fputs("\n\n", stderr); \
|
||||
#define LOG_STACK() \
|
||||
if (self->print_debugging_graphs) { \
|
||||
ts_stack_print_dot_graph(self->stack, self->language->symbol_names, stderr); \
|
||||
fputs("\n\n", stderr); \
|
||||
}
|
||||
|
||||
#define LOG_TREE() \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue