summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2024-04-20 02:36:41 -0700
committerAaron Franke <arnfranke@yahoo.com>2024-04-20 02:36:41 -0700
commitb1f5e9fe3a0a8b8f99518eea0b39ea1625e4f657 (patch)
treeaceadf0996ca8360679d9f13abae01a8bf138824
parent4a0160241fd0c1e874e297f6b08676cf0761e5e8 (diff)
downloadredot-engine-b1f5e9fe3a0a8b8f99518eea0b39ea1625e4f657.tar.gz
Rename internal is_ascii_char to is_ascii_alphabet_char
-rw-r--r--core/io/json.cpp4
-rw-r--r--core/string/char_utils.h2
-rw-r--r--core/string/translation.cpp2
-rw-r--r--core/variant/variant_parser.cpp4
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/resources/syntax_highlighter.cpp2
-rw-r--r--scene/resources/visual_shader.cpp4
7 files changed, 10 insertions, 10 deletions
diff --git a/core/io/json.cpp b/core/io/json.cpp
index 5a1fe45f70..61051727c1 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -344,10 +344,10 @@ Error JSON::_get_token(const char32_t *p_str, int &index, int p_len, Token &r_to
r_token.value = number;
return OK;
- } else if (is_ascii_char(p_str[index])) {
+ } else if (is_ascii_alphabet_char(p_str[index])) {
String id;
- while (is_ascii_char(p_str[index])) {
+ while (is_ascii_alphabet_char(p_str[index])) {
id += p_str[index];
index++;
}
diff --git a/core/string/char_utils.h b/core/string/char_utils.h
index aa9bc198ca..fc2fbb95a1 100644
--- a/core/string/char_utils.h
+++ b/core/string/char_utils.h
@@ -92,7 +92,7 @@ static _FORCE_INLINE_ bool is_binary_digit(char32_t c) {
return (c == '0' || c == '1');
}
-static _FORCE_INLINE_ bool is_ascii_char(char32_t c) {
+static _FORCE_INLINE_ bool is_ascii_alphabet_char(char32_t c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
diff --git a/core/string/translation.cpp b/core/string/translation.cpp
index 613edd11cd..344fe42fa0 100644
--- a/core/string/translation.cpp
+++ b/core/string/translation.cpp
@@ -993,7 +993,7 @@ String TranslationServer::add_padding(const String &p_message, int p_length) con
}
const char32_t *TranslationServer::get_accented_version(char32_t p_character) const {
- if (!is_ascii_char(p_character)) {
+ if (!is_ascii_alphabet_char(p_character)) {
return nullptr;
}
diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp
index dcb94b16b1..06daaab6a2 100644
--- a/core/variant/variant_parser.cpp
+++ b/core/variant/variant_parser.cpp
@@ -489,11 +489,11 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
r_token.value = num.as_int();
}
return OK;
- } else if (is_ascii_char(cchar) || is_underscore(cchar)) {
+ } else if (is_ascii_alphabet_char(cchar) || is_underscore(cchar)) {
StringBuffer<> id;
bool first = true;
- while (is_ascii_char(cchar) || is_underscore(cchar) || (!first && is_digit(cchar))) {
+ while (is_ascii_alphabet_char(cchar) || is_underscore(cchar) || (!first && is_digit(cchar))) {
id += cchar;
cchar = p_stream->get_char();
first = false;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6bb745ac57..0bb77a92f2 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1187,7 +1187,7 @@ void TextEdit::_notification(int p_what) {
}
if (!clipped && lookup_symbol_word.length() != 0) { // Highlight word
- if (is_ascii_char(lookup_symbol_word[0]) || lookup_symbol_word[0] == '_' || lookup_symbol_word[0] == '.') {
+ if (is_ascii_alphabet_char(lookup_symbol_word[0]) || lookup_symbol_word[0] == '_' || lookup_symbol_word[0] == '.') {
int lookup_symbol_word_col = _get_column_pos_of_word(lookup_symbol_word, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, 0);
int lookup_symbol_word_len = lookup_symbol_word.length();
while (lookup_symbol_word_col != -1) {
diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp
index 441c8859cf..c735395829 100644
--- a/scene/resources/syntax_highlighter.cpp
+++ b/scene/resources/syntax_highlighter.cpp
@@ -313,7 +313,7 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting_impl(int p_line) {
}
}
- if (!in_word && (is_ascii_char(str[j]) || is_underscore(str[j])) && !is_number) {
+ if (!in_word && (is_ascii_alphabet_char(str[j]) || is_underscore(str[j])) && !is_number) {
in_word = true;
}
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 7e80d0be3c..6f1aa5c850 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -1463,7 +1463,7 @@ String VisualShader::validate_port_name(const String &p_port_name, VisualShaderN
return String();
}
- while (port_name.length() && !is_ascii_char(port_name[0])) {
+ while (port_name.length() && !is_ascii_alphabet_char(port_name[0])) {
port_name = port_name.substr(1, port_name.length() - 1);
}
@@ -1508,7 +1508,7 @@ String VisualShader::validate_port_name(const String &p_port_name, VisualShaderN
String VisualShader::validate_parameter_name(const String &p_name, const Ref<VisualShaderNodeParameter> &p_parameter) const {
String param_name = p_name; //validate name first
- while (param_name.length() && !is_ascii_char(param_name[0])) {
+ while (param_name.length() && !is_ascii_alphabet_char(param_name[0])) {
param_name = param_name.substr(1, param_name.length() - 1);
}
if (!param_name.is_empty()) {