diff --git a/src/Pig.cpp b/src/Pig.cpp index c281e34b..ad32fce1 100644 --- a/src/Pig.cpp +++ b/src/Pig.cpp @@ -40,6 +40,18 @@ Pig::Pig (const std::string& text) { } +//////////////////////////////////////////////////////////////////////////////// +bool Pig::skip (int c) +{ + if (_text[_cursor] == c) + { + ++_cursor; + return true; + } + + return false; +} + //////////////////////////////////////////////////////////////////////////////// bool Pig::skipN (const int quantity) { diff --git a/src/Pig.h b/src/Pig.h index ff1713b0..529b8f16 100644 --- a/src/Pig.h +++ b/src/Pig.h @@ -34,6 +34,7 @@ class Pig public: Pig (const std::string&); + bool skip (int); bool skipN (const int quantity = 1); bool skipWS (); bool skipLiteral (const std::string&);