From 3f2d377fef59cbb9265bf708a16806b602d5c19a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 Feb 2015 12:05:24 -0500 Subject: [PATCH] Lexer - Allow '=' in rc.[:=], but not in non-rc Lexer::Type::pair combinations. That means 'name=value' is not a Lexer::Type::pair. --- src/Lexer.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Lexer.cpp b/src/Lexer.cpp index f80b33199..3cbfa9b8b 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -695,8 +695,27 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type) Lexer::Type ignoredType; if (isIdentifier (ignoredToken, ignoredType)) { + if (ignoredToken == "rc" || + ignoredToken.substr (0, 3) == "rc.") + { + if (_eos - _cursor > 1 && + (_text[_cursor] == ':' || _text[_cursor] == '=')) + { + _cursor++; + + if (isString (ignoredToken, ignoredType, '\'') || + isString (ignoredToken, ignoredType, '"') || + isWord (ignoredToken, ignoredType)) + { + token = _text.substr (marker, _cursor - marker); + type = Lexer::Type::pair; + return true; + } + } + } + if (_eos - _cursor > 1 && - (_text[_cursor] == ':' || _text[_cursor] == '=')) + _text[_cursor] == ':') { _cursor++;