From 4d65fc4c56d42d194a313cbff6232974d4b2b91c Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 5 Mar 2015 17:50:19 -0500 Subject: [PATCH] Removed 'before/after' handlers. --- peglib.h | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/peglib.h b/peglib.h index 1d99766..8df0702 100644 --- a/peglib.h +++ b/peglib.h @@ -1183,15 +1183,11 @@ public: holder_->accept(v); } - std::string name; - size_t id; - - std::vector actions; - std::function before; - std::function after; - - bool ignoreSemanticValue; - bool enablePackratParsing; + std::string name; + size_t id; + std::vector actions; + bool ignoreSemanticValue; + bool enablePackratParsing; private: friend class DefinitionReference; @@ -1230,10 +1226,6 @@ inline int Holder::parse(const char* s, size_t l, SemanticValues& sv, Context& c c.packrat(s, outer_->id, len, val, [&](int& len, any& val) { auto& chldsv = c.push(); - if (outer_->before) { - outer_->before(dt); - } - const auto& rule = *ope_; len = rule.parse(s, l, chldsv, c, dt); ancl = len; @@ -1256,10 +1248,6 @@ inline int Holder::parse(const char* s, size_t l, SemanticValues& sv, Context& c val = reduce(chldsv, dt, action); } - if (outer_->after) { - outer_->after(dt); - } - c.pop(); });