diff --git a/src/Lexer.cpp b/src/Lexer.cpp index e9efbee0d..69466465e 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -1092,6 +1092,16 @@ bool Lexer::isLiteral (const std::string& literal) return false; } +//////////////////////////////////////////////////////////////////////////////// +bool Lexer::isOneOf (const std::vector & options) +{ + for (auto& item : options) + if (isLiteral (item)) + return true; + + return false; +} + //////////////////////////////////////////////////////////////////////////////// // Static std::string Lexer::typeToString (Lexer::Type type) diff --git a/src/Lexer.h b/src/Lexer.h index 18857ea61..5042255c7 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -105,6 +105,7 @@ public: bool isIdentifier (std::string&, Lexer::Type&); bool isWord (std::string&, Lexer::Type&); bool isLiteral (const std::string&); + bool isOneOf (const std::vector &); private: std::string _text;