mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Lexer
- 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:
parent
c849cc9bfe
commit
3f2d377fef
1 changed files with 20 additions and 1 deletions
|
@ -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++;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue