From 1594ee56133cd1b5e0a694eb75f3fd992d948a33 Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 8 Jun 2022 08:38:50 -0400 Subject: [PATCH] Fixed problem with `Result::le` --- peglib.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/peglib.h b/peglib.h index 03d811f..cb7cf47 100644 --- a/peglib.h +++ b/peglib.h @@ -2401,14 +2401,18 @@ private: auto len = whitespaceOpe->parse(s, n, vs, c, dt); if (fail(len)) { - return Result{success(len), c.recovered, len, c.error_info}; + return Result{false, c.recovered, i, c.error_info}; } i = len; } auto len = ope->parse(s + i, n - i, vs, c, dt); - return Result{success(i + len), c.recovered, i + len, c.error_info}; + if (success(len)) { + return Result{true, c.recovered, i + len, c.error_info}; + } else { + return Result{false, c.recovered, i, c.error_info}; + } } std::shared_ptr holder_;