mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Pig: Added ::skipLiteral
This commit is contained in:
parent
1e02140695
commit
2810b8fabf
2 changed files with 13 additions and 0 deletions
12
src/Pig.cpp
12
src/Pig.cpp
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
|
||||
bool skipN (const int quantity = 1);
|
||||
bool skipWS ();
|
||||
bool skipLiteral (const std::string&);
|
||||
|
||||
bool getDigit (int&);
|
||||
bool getDigits (int&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue