diff --git a/docs/native.wasm b/docs/native.wasm index 78bc007..f194508 100755 Binary files a/docs/native.wasm and b/docs/native.wasm differ diff --git a/peglib.h b/peglib.h index 70d98f6..ec3a7f5 100644 --- a/peglib.h +++ b/peglib.h @@ -1125,7 +1125,7 @@ public: count++; } - while (n - i > 0 && count < max_) { + while (count < max_) { c.push_capture_scope(); auto se = scope_exit([&]() { c.pop_capture_scope(); }); auto save_sv_size = vs.size(); @@ -2936,11 +2936,6 @@ inline size_t Recovery::parse_core(const char *s, size_t n, if (success(len)) { c.recovered = true; - - if (c.log) { - c.error_info.output_log(c.log, c.s, c.l); - c.error_info.clear(); - } } // Cut diff --git a/test/test2.cc b/test/test2.cc index 3718d64..6f1cd05 100644 --- a/test/test2.cc +++ b/test/test2.cc @@ -1452,20 +1452,20 @@ rrr | sss TEST(ErrorTest, Error_recovery_2) { parser pg(R"( - START <- ENTRY ((',' ENTRY) / %recover((!(',' / Space) .)+))* (_ / %recover(.*)) + START <- ENTRY (',' ENTRY)* _* ENTRY <- '[' ITEM (',' ITEM)* ']' ITEM <- WORD / NUM / %recover((!(',' / ']') .)+) NUM <- [0-9]+ ![a-z] WORD <- '"' [a-z]+ '"' - ~_ <- Space* + ~_ <- Space Space <- [ \n] )"); EXPECT_TRUE(!!pg); std::vector errors{ - R"(1:6: syntax error, unexpected ']', expecting ','.)", + R"(1:6: syntax error, unexpected ']', expecting .)", R"(1:18: syntax error, unexpected 'z', expecting .)", R"(1:24: syntax error, unexpected ',', expecting '"'.)", R"(1:31: syntax error, unexpected 'ccc', expecting '"', .)",