Pig: Added ::skipLiteral

This commit is contained in:
Paul Beckingham 2015-12-29 23:00:53 -05:00
parent 1e02140695
commit 2810b8fabf
2 changed files with 13 additions and 0 deletions

View file

@ -76,6 +76,18 @@ bool Pig::skipWS ()
return _cursor > save;
}
////////////////////////////////////////////////////////////////////////////////
bool Pig::skipLiteral (const std::string& literal)
{
if (_text.find (literal) == _cursor)
{
_cursor += literal.length ();
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Pig::getDigit (int& result)
{

View file

@ -36,6 +36,7 @@ public:
bool skipN (const int quantity = 1);
bool skipWS ();
bool skipLiteral (const std::string&);
bool getDigit (int&);
bool getDigits (int&);