Pig: Added ::getDigit

This commit is contained in:
Paul Beckingham 2015-12-29 15:53:51 -05:00
parent d1fbda2c11
commit ddbf675d40
2 changed files with 17 additions and 0 deletions

View file

@ -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)
{