From 970537730fc3014e5efbc5bd0f4a082237b7eaae Mon Sep 17 00:00:00 2001 From: yhirose Date: Sat, 25 Jun 2022 06:29:50 -0400 Subject: [PATCH] Fix #217 --- docs/native.wasm | Bin 416419 -> 416307 bytes peglib.h | 7 +------ test/test2.cc | 6 +++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/native.wasm b/docs/native.wasm index 78bc0073c01e8ad7aec3dd7a30359d61550ad5a5..f1945081ca5e283fa4bb9906431106b13cc55ae2 100755 GIT binary patch delta 15405 zcmd6O33OCdw)Wj;sJfM^RBlK@s*(_H6@y_+XeFR1<}!+apz>5~^mW^>QG+Nb?JN}# z1r!u4;D9I~D##3$Z~*}UQ3eOV0dWM8Nu02?6-VB8ZdDRcSO4!{Z~bfiRZ#n$aqqLw zp3XiuPp*uno{KJT$M{q;nLLZNks-^JW^yoV&X`C(#G2;|hG(878Iz_kDG-p-m)y!q zo3kuIK5j5yVHW<$JhILpVn)DVgpVu}oP10sL%f`kOrFOtNSKTfKp@~V@CgQ)KjM#s@$rYl*@j<#DBA-Dj~3U5zOwbu%6|sk`xzNj;2-CiOHXn1N5iWH=N&Zq7GP%5mme z-w}UR)hvF}|EvFPf7N*Z55C9vPTv;a2H#TOgT5c+H}VU4NFJ2?@TGh{N>A}8`8@L}^Ko;Ud0upq`JnlLIo_;_R(hYYrUyz&0Pfe%C6)J?W6<$l zbF?|itTBJ_|Li|6`jh`h{}28X{_m4_`OEVT`w#gK`akhkMGyEt_Q#|9{ri&Z{dZW8 z@a6tx{-yr=sAP$MvHy`&4>OPQ*7)Ml)jrp^%2yR#>3a^PRPu(vBZ*(-FEaYG{7J^6 zKgtvGdl~&s{tJa~slv3F$M~o-|Bk;fEKH4DH%aV1ndQR4m{^~w81csy}pniT=rXuZVYP zhuAI}#!v9?_)B~>?ZWJ5Dda+JyW82tT zu|}*GtHeqXeNH?pR*2Ikj+2bd0!HL`REJB3dI( z^60Pp7apCJ|bOX|+j9|X-!jc78C(T3D7&9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z{BsbA*M>B)sxg=U@$So zmt+@hDj{HAxE7NP97sk--hcKD^LpH6z0h^8Vt*@S5F1GwFUGqS^%)`LJ{22#;J}zKpAL-;G4RWx4c5X@hj4EYN#2lgMbaa z$;ZG04Eao!yeK0Hl4?Wc)-2f+`+{J$+@BGKaqu2_npkdYqoN%7JpxWa2YiN91)cGl z-_~9QHec&@t1C08d74x4EO4T=*mx)@2f-rNM~haPh5Iz!oA6x%yee@%s$&P#_*{7a zulf5&WQ=gSKzgy|;dMsF0Q?dw#}V_}D3;Sp1_mbT>Wb>>d)S-v`+!t~Z}?_kt$8 zkmx!0=Ck?70b1fVY{~EQBOQAYf7DMST&n~B8>b2C{?5E1aH!6F1jW?!0$J$3Rv=sB z8yoHpTNX0?)fTIx%Noc`sUAIB7PwhO@=jd+o-JESTBIhnl13uh=i#*BcSvTWy*^<*|ZpW+SO^m*GU%Wi)@>}=8K5{*yMQ+!7 z<$Hdb<@z6zrVgZ9kH|vP97=d0<&3ycJ^n3gpq?HnZ*`mYmm3*9r+fp!x$*A#17#0E zN{t>OAEI%tIaID8#9ucK!#8VDJ~UiDLhjL#vX5E6o5nTdXK!l^TA{dbNCxbf0lrwH z)E*@-RDT&KV`2giHdk+slO^t~aWX>g;+gUZ@_8a-sKW8`^|VU}9v=_L&QZ7CC|jxb z$IB=3y{A84dN&&Sr7Iq63=VitQmhx%)6dBcYS(k}g5(>OB$OL{UN#rBOkFxrwns8* zB9?iXS~*c(NXuL{N$w(gN$q_}Hbas#Sh$~9X?o`vJWutVf-gkeFhw2;t|0yWA7{U1t#Et3EYFs-+#NDi)+anlnL17W%J_0J V)D_RNTy;w$*3a$mhCDjs{{X}Al^_5B 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 '"', .)",