From 9679cdcc27b65fef24b63865a84ec061296ac0f3 Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 29 Jan 2020 22:48:00 -0500 Subject: [PATCH] Removed search method --- peglib.h | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/peglib.h b/peglib.h index 83448c8..243b111 100644 --- a/peglib.h +++ b/peglib.h @@ -3500,31 +3500,6 @@ public: return parse_n(s, n, dt, val); } - bool search(const char* s, size_t n, size_t& mpos, size_t& mlen) const { - const auto& rule = (*grammar_)[start_]; - if (grammar_ != nullptr) { - size_t pos = 0; - while (pos < n) { - size_t len = n - pos; - auto r = rule.parse(s + pos, len); - if (r.ret) { - mpos = pos; - mlen = len; - return true; - } - pos++; - } - } - mpos = 0; - mlen = 0; - return false; - } - - bool search(const char* s, size_t& mpos, size_t& mlen) const { - auto n = strlen(s); - return search(s, n, mpos, mlen); - } - Definition& operator[](const char* s) { return (*grammar_)[s]; }