- Added a new type Lexer::typeTag.
This commit is contained in:
Paul Beckingham 2014-09-07 01:17:48 -04:00
parent 0b9c84511b
commit aab23692f1
3 changed files with 41 additions and 1 deletions

View file

@ -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";
}
}