- 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

@ -695,8 +695,27 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
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 &&
(_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 && if (_eos - _cursor > 1 &&
(_text[_cursor] == ':' || _text[_cursor] == '=')) _text[_cursor] == ':')
{ {
_cursor++; _cursor++;