Lexer: Migrated to unicodeLatinAlpha

This commit is contained in:
Paul Beckingham 2018-01-25 00:59:05 -05:00
parent ea26369f80
commit 0086a51311
2 changed files with 3 additions and 11 deletions

View file

@ -143,13 +143,6 @@ const std::string Lexer::typeName (const Lexer::Type& type)
return "unknown";
}
////////////////////////////////////////////////////////////////////////////////
bool Lexer::isAlpha (int c)
{
return (c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z');
}
////////////////////////////////////////////////////////////////////////////////
// Digits 0-9.
//
@ -225,7 +218,7 @@ bool Lexer::isBoundary (int left, int right)
if (right == '\0') return true;
// XOR
if (isAlpha (left) != isAlpha (right)) return true;
if (unicodeLatinAlpha (left) != unicodeLatinAlpha (right)) return true;
if (isDigit (left) != isDigit (right)) return true;
if (unicodeWhitespace (left) != unicodeWhitespace (right)) return true;
@ -262,7 +255,7 @@ bool Lexer::isPunctuation (int c)
c != '$' &&
c != '_' &&
! isDigit (c) &&
! isAlpha (c);
! unicodeLatinAlpha (c);
}
////////////////////////////////////////////////////////////////////////////////
@ -1217,7 +1210,7 @@ bool Lexer::isDOM (std::string& token, Lexer::Type& type)
}
// Lookahead: !<alpha>
else if (! isAlpha (_text[marker]))
else if (! unicodeLatinAlpha (_text[marker]))
{
token = _text.substr (marker, _cursor - marker);
type = Lexer::Type::dom;

View file

@ -61,7 +61,6 @@ public:
// Static helpers.
static const std::string typeName (const Lexer::Type&);
static bool isAlpha (int);
static bool isDigit (int);
static bool isIdentifierStart (int);
static bool isIdentifierNext (int);