diff --git a/peglib.h b/peglib.h index 780eb34..80f6ddb 100644 --- a/peglib.h +++ b/peglib.h @@ -1740,19 +1740,19 @@ public: return is_token_; } - std::string name; - size_t id; - Action action; - std::function enter; - std::function leave; - std::function error_message; - bool ignoreSemanticValue; - std::shared_ptr whitespaceOpe; - std::shared_ptr wordOpe; - bool enablePackratParsing; - bool is_macro; - std::vector params; - Tracer tracer; + std::string name; + size_t id; + Action action; + std::function enter; + std::function leave; + std::function error_message; + bool ignoreSemanticValue; + std::shared_ptr whitespaceOpe; + std::shared_ptr wordOpe; + bool enablePackratParsing; + bool is_macro; + std::vector params; + Tracer tracer; private: friend class Reference; @@ -1883,14 +1883,14 @@ inline size_t Holder::parse(const char* s, size_t n, SemanticValues& sv, Context c.packrat(s, outer_->id, len, val, [&](any& a_val) { if (outer_->enter) { - outer_->enter(dt); + outer_->enter(s, n, dt); } auto se2 = make_scope_exit([&]() { c.pop(); if (outer_->leave) { - outer_->leave(dt); + outer_->leave(s, n, len, a_val, dt); } });