MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / is_valid_unicode_identifier

Method is_valid_unicode_identifier

core/string/ustring.cpp:4620–4638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4618}
4619
4620bool String::is_valid_unicode_identifier() const {
4621 const char32_t *str = ptr();
4622 int len = length();
4623
4624 if (len == 0) {
4625 return false; // Empty string.
4626 }
4627
4628 if (!is_unicode_identifier_start(str[0])) {
4629 return false;
4630 }
4631
4632 for (int i = 1; i < len; i++) {
4633 if (!is_unicode_identifier_continue(str[i])) {
4634 return false;
4635 }
4636 }
4637 return true;
4638}
4639
4640bool String::is_valid_string() const {
4641 int l = length();

Callers 5

drop_data_fwMethod · 0.80
test_string.hFile · 0.80
is_valid_identifierMethod · 0.80

Calls 2

Tested by

no test coverage detected