Lexer: Implemented ::isOneOf, to help with parsing

This commit is contained in:
Paul Beckingham 2015-07-25 17:34:51 -04:00
parent 9394b96202
commit 37e31e8e0b
2 changed files with 11 additions and 0 deletions

View file

@ -1092,6 +1092,16 @@ bool Lexer::isLiteral (const std::string& literal)
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Lexer::isOneOf (const std::vector <std::string>& options)
{
for (auto& item : options)
if (isLiteral (item))
return true;
return false;
}
////////////////////////////////////////////////////////////////////////////////
// Static
std::string Lexer::typeToString (Lexer::Type type)