Lexer
- Added downgrade from typeNumber to typeIdentifer if a number is followed by a letter, thus supporting "9th" as an identifier. This causes much breakage.
This commit is contained in:
@@ -123,6 +123,8 @@ bool Lexer::token (std::string& result, Type& type)
|
|||||||
|
|
||||||
// Try a legacy rc.dateformat parse here.
|
// Try a legacy rc.dateformat parse here.
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if (Lexer::dateFormat != "")
|
||||||
{
|
{
|
||||||
std::string::size_type start = _i < 4 ? 0 : _i - 4;
|
std::string::size_type start = _i < 4 ? 0 : _i - 4;
|
||||||
std::string::size_type space = _input.find (' ', _i);
|
std::string::size_type space = _input.find (' ', _i);
|
||||||
@@ -138,6 +140,7 @@ bool Lexer::token (std::string& result, Type& type)
|
|||||||
type = typeDate;
|
type = typeDate;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
catch (...) { /* Never mind. */ }
|
catch (...) { /* Never mind. */ }
|
||||||
|
|
||||||
@@ -345,6 +348,12 @@ bool Lexer::token (std::string& result, Type& type)
|
|||||||
result += utf8_character (_n0);
|
result += utf8_character (_n0);
|
||||||
shift ();
|
shift ();
|
||||||
}
|
}
|
||||||
|
else if (is_ident_start (_n0))
|
||||||
|
{
|
||||||
|
type = typeIdentifier;
|
||||||
|
result += utf8_character (_n0);
|
||||||
|
shift ();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user