[ion/unicode] Split isDigit into isDecimalDigit, isBinaryDigit, isHexadecimalDigit

This commit is contained in:
Ruben Dashyan
2020-01-27 15:16:05 +01:00
committed by Léa Saviot
parent d48a882f04
commit 575b911da9
4 changed files with 17 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ bool Function::BaseNameCompliant(const char * baseName, NameNotCompliantError *
UTF8Decoder decoder(baseName);
CodePoint c = decoder.nextCodePoint();
if (c.isDigit()) {
if (c.isDecimalDigit()) {
// The name cannot start with a number
if (error != nullptr) {
*error = NameNotCompliantError::NameCannotStartWithNumber;
@@ -27,7 +27,7 @@ bool Function::BaseNameCompliant(const char * baseName, NameNotCompliantError *
while (c != UCodePointNull) {
// FIXME '_' should be accepted but not as first character
// TODO Factor this piece of code with similar one in the Parser
if (!(c.isLetter() || c.isDigit()) || c == '_') {
if (!(c.isLetter() || c.isDecimalDigit()) || c == '_') {
if (error != nullptr) {
*error = NameNotCompliantError::CharacterNotAllowed;
}