Expressions

- Reordered operator table so that longer operators match first, thus
  disambiguating between ! and !=.
- Eliminated Expression::expand_expression.
- Modified Nibbler to know what a DOM reference looks like.
- Removed alpha equivalent operators (lt, le, gt, ge, not, eq, ne) because
  these are common in descriptions (French: le, ne).
- Modified Arguments and Nibbler unit tests.
This commit is contained in:
Paul Beckingham 2011-06-13 00:45:06 -04:00
parent a749f83da3
commit d6670ba198
7 changed files with 140 additions and 185 deletions

View file

@ -908,6 +908,32 @@ bool Nibbler::getOneOf (
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::getDOM (std::string& found)
{
std::string::size_type i = mCursor;
std::string::size_type start = mCursor;
while ( isdigit (mInput[i]) ||
mInput[i] == '.' ||
mInput[i] == '-' ||
mInput[i] == '_' ||
(! ispunct (mInput[i]) &&
! isspace (mInput[i])))
{
++i;
}
if (i > mCursor)
{
found = mInput.substr (start, i - start);
mCursor = i;
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::skipN (const int quantity /* = 1 */)
{