diff --git a/src/Lexer.cpp b/src/Lexer.cpp index e11d20ac1..c09e88b99 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -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; diff --git a/src/Lexer.h b/src/Lexer.h index 0258f29f8..afd7a0dc5 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -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);