Bug - Durations

- Duration were parsed as <int><unit> in A3, whereas <number><unit> is
  correct.
- Added Nibbler::str method for internal access.
- Nibbler::save, ::restore now return positions.  Useful for extracting
  substrings.
- Modified countdown.t to use the (now) correct units for durations.
This commit is contained in:
Paul Beckingham 2011-08-17 00:45:09 -04:00
parent ee2960b9b0
commit 08fcb5362e
5 changed files with 39 additions and 16 deletions

View file

@ -1116,15 +1116,21 @@ std::string Nibbler::next (const int quantity)
}
////////////////////////////////////////////////////////////////////////////////
void Nibbler::save ()
std::string::size_type Nibbler::save ()
{
mSaved = mCursor;
return mSaved = mCursor;
}
////////////////////////////////////////////////////////////////////////////////
void Nibbler::restore ()
std::string::size_type Nibbler::restore ()
{
mCursor = mSaved;
return mCursor = mSaved;
}
////////////////////////////////////////////////////////////////////////////////
const std::string& Nibbler::str () const
{
return mInput;
}
////////////////////////////////////////////////////////////////////////////////