mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Pig: Added ::getDigit
This commit is contained in:
parent
d1fbda2c11
commit
ddbf675d40
2 changed files with 17 additions and 0 deletions
15
src/Pig.cpp
15
src/Pig.cpp
|
@ -63,6 +63,21 @@ bool Pig::skipWS ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Pig::getDigit (int& result)
|
||||||
|
{
|
||||||
|
int c = _text[_cursor];
|
||||||
|
if (Lexer::isDigit (c))
|
||||||
|
{
|
||||||
|
result = c - '0';
|
||||||
|
++_cursor;
|
||||||
|
++_mark;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Pig::debug (bool value)
|
void Pig::debug (bool value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,6 +36,8 @@ public:
|
||||||
|
|
||||||
bool skipWS ();
|
bool skipWS ();
|
||||||
|
|
||||||
|
bool getDigit (int&);
|
||||||
|
|
||||||
void debug (bool);
|
void debug (bool);
|
||||||
std::string dump () const;
|
std::string dump () const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue