mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Fixed AST problem with And and Not predicates.
This commit is contained in:
parent
927ecc5c37
commit
79c6b7ce9b
9
peglib.h
9
peglib.h
@ -712,7 +712,9 @@ public:
|
|||||||
|
|
||||||
size_t parse(const char* s, size_t n, SemanticValues& sv, Context& c, any& dt) const override {
|
size_t parse(const char* s, size_t n, SemanticValues& sv, Context& c, any& dt) const override {
|
||||||
const auto& rule = *ope_;
|
const auto& rule = *ope_;
|
||||||
auto len = rule.parse(s, n, sv, c, dt);
|
auto& chldsv = c.push();
|
||||||
|
auto len = rule.parse(s, n, chldsv, c, dt);
|
||||||
|
c.pop();
|
||||||
if (success(len)) {
|
if (success(len)) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
@ -734,8 +736,11 @@ public:
|
|||||||
size_t parse(const char* s, size_t n, SemanticValues& sv, Context& c, any& dt) const override {
|
size_t parse(const char* s, size_t n, SemanticValues& sv, Context& c, any& dt) const override {
|
||||||
const auto& rule = *ope_;
|
const auto& rule = *ope_;
|
||||||
auto error_pos = c.error_pos;
|
auto error_pos = c.error_pos;
|
||||||
|
auto& chldsv = c.push();
|
||||||
auto len = rule.parse(s, n, sv, c, dt);
|
auto len = rule.parse(s, n, sv, c, dt);
|
||||||
if (success(len)) {
|
c.pop();
|
||||||
|
if (success(len))
|
||||||
|
{
|
||||||
c.set_error_pos(s);
|
c.set_error_pos(s);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user