Pig: Added ::peek

This commit is contained in:
Paul Beckingham 2015-12-30 10:26:58 -05:00
parent e790165a72
commit ad8ee168e5
2 changed files with 8 additions and 0 deletions

View file

@ -269,6 +269,13 @@ bool Pig::eos () const
return _text[_cursor] == '\0';
}
////////////////////////////////////////////////////////////////////////////////
// Peeks ahead - does not move cursor.
int Pig::peek () const
{
return _text[_cursor];
}
////////////////////////////////////////////////////////////////////////////////
std::string Pig::dump () const
{

View file

@ -46,6 +46,7 @@ public:
bool getRemainder (std::string&);
bool eos () const;
int peek () const;
std::string dump () const;