Fixed problem with Result::le

This commit is contained in:
yhirose 2022-06-08 08:38:50 -04:00
parent ee2dad387d
commit 1594ee5613

View File

@ -2401,14 +2401,18 @@ private:
auto len = whitespaceOpe->parse(s, n, vs, c, dt); auto len = whitespaceOpe->parse(s, n, vs, c, dt);
if (fail(len)) { if (fail(len)) {
return Result{success(len), c.recovered, len, c.error_info}; return Result{false, c.recovered, i, c.error_info};
} }
i = len; i = len;
} }
auto len = ope->parse(s + i, n - i, vs, c, dt); 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> holder_; std::shared_ptr<Holder> holder_;