mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
unicode: Renamed unicodeAlpha to unicodeLatinAlpha
This commit is contained in:
parent
26e69225b4
commit
8db7077e12
4 changed files with 10 additions and 10 deletions
|
@ -241,7 +241,7 @@ bool Lexer::isBoundary (int left, int right)
|
||||||
if (right == '\0') return true;
|
if (right == '\0') return true;
|
||||||
|
|
||||||
// XOR
|
// XOR
|
||||||
if (unicodeAlpha (left) != unicodeAlpha (right)) return true;
|
if (unicodeLatinAlpha (left) != unicodeLatinAlpha (right)) return true;
|
||||||
if (isDigit (left) != isDigit (right)) return true;
|
if (isDigit (left) != isDigit (right)) return true;
|
||||||
if (unicodeWhitespace (left) != unicodeWhitespace (right)) return true;
|
if (unicodeWhitespace (left) != unicodeWhitespace (right)) return true;
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ bool Lexer::isPunctuation (int c)
|
||||||
c != '$' &&
|
c != '$' &&
|
||||||
c != '_' &&
|
c != '_' &&
|
||||||
! isDigit (c) &&
|
! isDigit (c) &&
|
||||||
! unicodeAlpha (c);
|
! unicodeLatinAlpha (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -71,7 +71,7 @@ bool unicodeWhitespace (unsigned int c)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// TODO Needs better definition.
|
// TODO Needs better definition.
|
||||||
bool unicodeAlpha (unsigned int c)
|
bool unicodeLatinAlpha (unsigned int c)
|
||||||
{
|
{
|
||||||
return (c >= 'A' && c <= 'Z') ||
|
return (c >= 'A' && c <= 'Z') ||
|
||||||
(c >= 'a' && c <= 'z');
|
(c >= 'a' && c <= 'z');
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#define INCLUDED_UNICODE
|
#define INCLUDED_UNICODE
|
||||||
|
|
||||||
bool unicodeWhitespace (unsigned int);
|
bool unicodeWhitespace (unsigned int);
|
||||||
bool unicodeAlpha (unsigned int);
|
bool unicodeLatinAlpha (unsigned int);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -62,12 +62,12 @@ int main (int, char**)
|
||||||
t.ok (unicodeWhitespace (0x205F), "U+205F unicodeWhitespace");
|
t.ok (unicodeWhitespace (0x205F), "U+205F unicodeWhitespace");
|
||||||
t.ok (unicodeWhitespace (0x3000), "U+3000 unicodeWhitespace");
|
t.ok (unicodeWhitespace (0x3000), "U+3000 unicodeWhitespace");
|
||||||
|
|
||||||
// Alpha
|
// Latin Alpha
|
||||||
t.notok (unicodeAlpha (0x0033), "U+0033 (3) ! unicodeAlpha");
|
t.notok (unicodeLatinAlpha (0x0033), "U+0033 (3) ! unicodeLatinAlpha");
|
||||||
t.ok (unicodeAlpha (0x0041), "U+0041 (A) unicodeAlpha");
|
t.ok (unicodeLatinAlpha (0x0041), "U+0041 (A) unicodeLatinAlpha");
|
||||||
t.ok (unicodeAlpha (0x005A), "U+005A (Z) unicodeAlpha");
|
t.ok (unicodeLatinAlpha (0x005A), "U+005A (Z) unicodeLatinAlpha");
|
||||||
t.ok (unicodeAlpha (0x0061), "U+0061 (a) unicodeAlpha");
|
t.ok (unicodeLatinAlpha (0x0061), "U+0061 (a) unicodeLatinAlpha");
|
||||||
t.ok (unicodeAlpha (0x007A), "U+007A (z) unicodeAlpha");
|
t.ok (unicodeLatinAlpha (0x007A), "U+007A (z) unicodeLatinAlpha");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue