mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +00:00
Fix #236
This commit is contained in:
parent
4198d81bc6
commit
cc7330176f
5
peglib.h
5
peglib.h
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user