mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Pig: Added ::skip
This commit is contained in:
parent
09f23afc38
commit
6d47b1ba3a
2 changed files with 13 additions and 0 deletions
12
src/Pig.cpp
12
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)
|
||||
{
|
||||
|
|
|
@ -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&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue