mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[ion/unicode] Define and use CodePoint const methods
isLowerCaseLetter isUpperCaseLetter isLetter isDigit Remove similar ones from UTF8Helper and from Poincare::Tokenizer.
This commit is contained in:
committed by
Léa Saviot
parent
7665ad6fe0
commit
9b0b4e3096
@@ -48,7 +48,7 @@ bool Script::nameCompliant(const char * name) {
|
||||
* problems with case sensitivity. */
|
||||
UTF8Decoder decoder(name);
|
||||
CodePoint c = decoder.nextCodePoint();
|
||||
if (c == UCodePointNull || !(UTF8Helper::CodePointIsLowerCaseLetter(c) || c == '_' || c == '.')) {
|
||||
if (c == UCodePointNull || !(c.isLowerCaseLetter() || c == '_' || c == '.')) {
|
||||
/* The name cannot be empty. Its first letter must be in [a-z_] or the
|
||||
* extension dot. */
|
||||
return false;
|
||||
@@ -57,7 +57,7 @@ bool Script::nameCompliant(const char * name) {
|
||||
if (c == '.' && strcmp(decoder.stringPosition(), ScriptStore::k_scriptExtension) == 0) {
|
||||
return true;
|
||||
}
|
||||
if (!(UTF8Helper::CodePointIsLowerCaseLetter(c) || c == '_' || UTF8Helper::CodePointIsNumber(c))) {
|
||||
if (!(c.isLowerCaseLetter() || c == '_' || c.isDigit())) {
|
||||
return false;
|
||||
}
|
||||
c = decoder.nextCodePoint();
|
||||
|
||||
Reference in New Issue
Block a user