mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Pig: Removed unnecessary _mark, _debug
This commit is contained in:
parent
eaf038f50e
commit
b19496b63d
3 changed files with 7 additions and 24 deletions
20
src/Pig.cpp
20
src/Pig.cpp
|
@ -33,15 +33,15 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
Pig::Pig (const std::string& text)
|
||||
: _text (text)
|
||||
, _mark (0)
|
||||
, _cursor (0)
|
||||
, _debug (false)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Pig::skipWS ()
|
||||
{
|
||||
auto save = _cursor;
|
||||
|
||||
int c;
|
||||
auto prev = _cursor;
|
||||
while ((c = utf8_next_char (_text, _cursor)))
|
||||
|
@ -54,13 +54,7 @@ bool Pig::skipWS ()
|
|||
prev = _cursor;
|
||||
}
|
||||
|
||||
if (_cursor > _mark)
|
||||
{
|
||||
_mark = _cursor;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return _cursor > save;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -71,26 +65,18 @@ bool Pig::getDigit (int& result)
|
|||
{
|
||||
result = c - '0';
|
||||
++_cursor;
|
||||
++_mark;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Pig::debug (bool value)
|
||||
{
|
||||
_debug = value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Pig::dump () const
|
||||
{
|
||||
std::stringstream out;
|
||||
out << "≪" << _text << "≫"
|
||||
<< " l" << _text.length ()
|
||||
<< " m" << _mark
|
||||
<< " c" << _cursor;
|
||||
|
||||
return out.str ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue