diff --git a/src/Lexer.cpp b/src/Lexer.cpp index bea0a5099..a4a14cb74 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -1127,6 +1127,16 @@ bool Lexer::isOneOf (const std::vector & options, bool endBoundary) return false; } +//////////////////////////////////////////////////////////////////////////////// +bool Lexer::isOneOf (const std::map & options, bool endBoundary) +{ + for (auto& item : options) + if (isLiteral (item.first, endBoundary)) + return true; + + return false; +} + //////////////////////////////////////////////////////////////////////////////// // Static std::string Lexer::typeToString (Lexer::Type type) diff --git a/src/Lexer.h b/src/Lexer.h index 93aec21cb..476776755 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -28,6 +28,7 @@ #define INCLUDED_LEXER #include +#include #include #include @@ -107,6 +108,7 @@ public: bool isWord (std::string&, Lexer::Type&); bool isLiteral (const std::string&, bool); bool isOneOf (const std::vector &, bool); + bool isOneOf (const std::map &, bool); private: std::string _text;