Nibbler: Removed unused ::backN method

This commit is contained in:
Paul Beckingham 2015-10-29 23:55:43 -04:00
parent 297f2b6e99
commit dd82835ac4
3 changed files with 1 additions and 25 deletions

View file

@ -538,18 +538,6 @@ bool Nibbler::skipWS ()
return this->skipAllOneOf (" \t\n\r\f"); return this->skipAllOneOf (" \t\n\r\f");
} }
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::backN (const int quantity /*= 1*/)
{
if (_cursor >= (unsigned) quantity)
{
_cursor -= (unsigned) quantity;
return true;
}
return false;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool Nibbler::skipAllOneOf (const std::string& chars) bool Nibbler::skipAllOneOf (const std::string& chars)
{ {

View file

@ -66,8 +66,6 @@ public:
bool skipAllOneOf (const std::string&); bool skipAllOneOf (const std::string&);
bool skipWS (); bool skipWS ();
bool backN (const int quantity = 1);
char next (); char next ();
std::string next (const int quantity); std::string next (const int quantity);

View file

@ -35,7 +35,7 @@ Context context;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int main (int, char**) int main (int, char**)
{ {
UnitTest t (246); UnitTest t (240);
// Ensure environment has no influence. // Ensure environment has no influence.
unsetenv ("TASKDATA"); unsetenv ("TASKDATA");
@ -58,7 +58,6 @@ int main (int, char**)
t.notok (n.skipN (123), "trivial: skipN"); t.notok (n.skipN (123), "trivial: skipN");
t.notok (n.skip ('x'), "trivial: skip"); t.notok (n.skip ('x'), "trivial: skip");
t.notok (n.skipAllOneOf ("abc"), "trivial: skipAllOneOf"); t.notok (n.skipAllOneOf ("abc"), "trivial: skipAllOneOf");
t.notok (n.backN (1), "trivial: backN");
t.notok (n.getQuoted ('"', s), "trivial: getQuoted"); t.notok (n.getQuoted ('"', s), "trivial: getQuoted");
t.notok (n.getDigit (i), "trivial: getDigit"); t.notok (n.getDigit (i), "trivial: getDigit");
t.notok (n.getInt (i), "trivial: getInt"); // 10 t.notok (n.getInt (i), "trivial: getInt"); // 10
@ -144,15 +143,6 @@ int main (int, char**)
t.is (s, "foo", " 'foo' : getUntilEOS () -> 'foo'"); t.is (s, "foo", " 'foo' : getUntilEOS () -> 'foo'");
t.ok (n.depleted (), " '' : depleted () -> true"); t.ok (n.depleted (), " '' : depleted () -> true");
// bool backN (const int quantity = 1);
t.diag ("Nibbler::backN");
n = Nibbler ("/a/b/");
t.ok (n.getQuoted ('/', s), " '/a/b/' : getQuoted ('/') -> true");
t.is (s, "a", " 'b/' : getQuoted ('/') -> 'a'");
t.ok (n.backN (), " 'b/' : backN () -> true");
t.ok (n.getQuoted ('/', s), " '/b/' : getQuoted ('/') -> true");
t.is (s, "b", " '/b/' : getQuoted ('/') -> 'b'");
// bool getQuoted (char, std::string&); // bool getQuoted (char, std::string&);
t.diag ("Nibbler::getQuoted"); t.diag ("Nibbler::getQuoted");
n = Nibbler ("''"); n = Nibbler ("''");