This commit is contained in:
yhirose 2022-08-01 23:26:26 -04:00
parent 4198d81bc6
commit cc7330176f

View File

@ -2671,7 +2671,10 @@ inline void Context::set_error_pos(const char *a_s, const char *literal) {
}
}
if (!rule_stack.empty()) { error_rule = rule_stack.back(); }
for (auto r : rule_stack) {
error_rule = r;
if (r->is_token()) { break; }
}
if (error_literal || error_rule) {
error_info.add(error_literal, error_rule);