mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +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
|
c == 0x3000); // ideographic space Common Separator, space
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Lexer::isAlpha (int c)
|
||||||
|
{
|
||||||
|
return (c >= 'A' && c <= 'Z') ||
|
||||||
|
(c >= 'a' && c <= 'z');
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Digits 0-9.
|
// Digits 0-9.
|
||||||
bool Lexer::isDigit (int c)
|
bool Lexer::isDigit (int c)
|
||||||
|
@ -279,7 +286,7 @@ bool Lexer::isBoundary (int left, int right)
|
||||||
if (right == '\0') return true;
|
if (right == '\0') return true;
|
||||||
|
|
||||||
// XOR
|
// XOR
|
||||||
if (isalpha (left) != isalpha (right)) return true;
|
if (isAlpha (left) != isAlpha (right)) return true;
|
||||||
if (isDigit (left) != isDigit (right)) return true;
|
if (isDigit (left) != isDigit (right)) return true;
|
||||||
if (isWhitespace (left) != isWhitespace (right)) return true;
|
if (isWhitespace (left) != isWhitespace (right)) return true;
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
// Static helpers.
|
// Static helpers.
|
||||||
static const std::string typeName (const Lexer::Type&);
|
static const std::string typeName (const Lexer::Type&);
|
||||||
static bool isWhitespace (int);
|
static bool isWhitespace (int);
|
||||||
|
static bool isAlpha (int);
|
||||||
static bool isDigit (int);
|
static bool isDigit (int);
|
||||||
static bool isHexDigit (int);
|
static bool isHexDigit (int);
|
||||||
static bool isIdentifierStart (int);
|
static bool isIdentifierStart (int);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue