- Allow '=' in rc.<name>[:=]<value>, but not in non-rc Lexer::Type::pair
  combinations. That means 'name=value' is not a Lexer::Type::pair.
This commit is contained in:
Paul Beckingham
2015-02-28 12:05:24 -05:00
parent c849cc9bfe
commit 3f2d377fef

View File

@@ -694,6 +694,9 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
std::string ignoredToken; std::string ignoredToken;
Lexer::Type ignoredType; Lexer::Type ignoredType;
if (isIdentifier (ignoredToken, ignoredType)) if (isIdentifier (ignoredToken, ignoredType))
{
if (ignoredToken == "rc" ||
ignoredToken.substr (0, 3) == "rc.")
{ {
if (_eos - _cursor > 1 && if (_eos - _cursor > 1 &&
(_text[_cursor] == ':' || _text[_cursor] == '=')) (_text[_cursor] == ':' || _text[_cursor] == '='))
@@ -711,6 +714,22 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
} }
} }
if (_eos - _cursor > 1 &&
_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;
}
}
}
_cursor = marker; _cursor = marker;
return false; return false;
} }