mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer: Migrated isalpha to Lexer::isAlpha
This commit is contained in:
parent
fe8d235a6b
commit
c6dbdf87a4
2 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue