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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue