Lexer: Migrated isalpha to Lexer::isAlpha

This commit is contained in:
Paul Beckingham 2015-04-16 23:23:28 -04:00
parent fe8d235a6b
commit c6dbdf87a4
2 changed files with 9 additions and 1 deletions

View file

@ -198,6 +198,13 @@ bool Lexer::isWhitespace (int c)
c == 0x3000); // ideographic space Common Separator, space
}
////////////////////////////////////////////////////////////////////////////////
bool Lexer::isAlpha (int c)
{
return (c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z');
}
////////////////////////////////////////////////////////////////////////////////
// Digits 0-9.
bool Lexer::isDigit (int c)
@ -279,7 +286,7 @@ bool Lexer::isBoundary (int left, int right)
if (right == '\0') return true;
// XOR
if (isalpha (left) != isalpha (right)) return true;
if (isAlpha (left) != isAlpha (right)) return true;
if (isDigit (left) != isDigit (right)) return true;
if (isWhitespace (left) != isWhitespace (right)) return true;

View file

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