mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer
- Added a new type Lexer::typeTag.
This commit is contained in:
parent
0b9c84511b
commit
aab23692f1
3 changed files with 41 additions and 1 deletions
|
@ -126,6 +126,12 @@ bool Lexer::token (std::string& result, Type& type)
|
|||
result += utf8_character (_n0);
|
||||
shift ();
|
||||
}
|
||||
else if ((_n0 == '+' || _n0 == '-') && is_ident_start (_n1))
|
||||
{
|
||||
type = typeTag;
|
||||
result += utf8_character (_n0);
|
||||
shift ();
|
||||
}
|
||||
else if (is_triple_op (_n0, _n1, _n2))
|
||||
{
|
||||
type = typeOperator;
|
||||
|
@ -199,6 +205,18 @@ bool Lexer::token (std::string& result, Type& type)
|
|||
}
|
||||
break;
|
||||
|
||||
case typeTag:
|
||||
if (is_ident_start (_n0))
|
||||
{
|
||||
result += utf8_character (_n0);
|
||||
shift ();
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case typeIdentifier:
|
||||
if (is_ident (_n0))
|
||||
{
|
||||
|
@ -552,6 +570,7 @@ const std::string Lexer::type_name (const Type& type)
|
|||
case Lexer::typeEscapeUnicode: return "EscapeUnicode";
|
||||
case Lexer::typeDate: return "Date";
|
||||
case Lexer::typeDuration: return "Duration";
|
||||
case Lexer::typeTag: return "Tag";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue