Removed 'before/after' handlers.

pull/3/head
yhirose 10 years ago
parent 0fa6af3cd5
commit 4d65fc4c56
  1. 12
      peglib.h

@ -1185,11 +1185,7 @@ public:
std::string name; std::string name;
size_t id; size_t id;
std::vector<Action> actions; std::vector<Action> actions;
std::function<void(any& dt)> before;
std::function<void(any& dt)> after;
bool ignoreSemanticValue; bool ignoreSemanticValue;
bool enablePackratParsing; bool enablePackratParsing;
@ -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) { c.packrat(s, outer_->id, len, val, [&](int& len, any& val) {
auto& chldsv = c.push(); auto& chldsv = c.push();
if (outer_->before) {
outer_->before(dt);
}
const auto& rule = *ope_; const auto& rule = *ope_;
len = rule.parse(s, l, chldsv, c, dt); len = rule.parse(s, l, chldsv, c, dt);
ancl = len; 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); val = reduce(chldsv, dt, action);
} }
if (outer_->after) {
outer_->after(dt);
}
c.pop(); c.pop();
}); });

Loading…
Cancel
Save