Lexer: Implemented ::isOneOf, to help with parsing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user