1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

Unicode: Try s/codepoint/code_point/g again

This time, without trailing 's'. Ran:

    git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
This commit is contained in:
Nico Weber 2020-08-05 16:31:20 -04:00 committed by Andreas Kling
parent 19ac1f6368
commit ce95628b7f
45 changed files with 441 additions and 441 deletions

View file

@ -834,7 +834,7 @@ NonnullRefPtr<StringLiteral> Parser::parse_string_literal(Token token)
auto type = status == Token::StringValueStatus::MalformedUnicodeEscape ? "unicode" : "hexadecimal";
message = String::format("Malformed %s escape sequence", type);
} else if (status == Token::StringValueStatus::UnicodeEscapeOverflow) {
message = "Unicode codepoint must not be greater than 0x10ffff in escape sequence";
message = "Unicode code_point must not be greater than 0x10ffff in escape sequence";
}
syntax_error(

View file

@ -69,7 +69,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringIteratorPrototype::next)
}
StringBuilder builder;
builder.append_codepoint(*utf8_iterator);
builder.append_code_point(*utf8_iterator);
++utf8_iterator;
return create_iterator_result_object(global_object, js_string(interpreter, builder.to_string()), false);

View file

@ -321,7 +321,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::substring)
if (interpreter.argument_count() == 0)
return js_string(interpreter, string);
// FIXME: index_start and index_end should index a UTF-16 codepoint view of the string.
// FIXME: index_start and index_end should index a UTF-16 code_point view of the string.
auto string_length = string.length();
auto index_start = min(interpreter.argument(0).to_size_t(interpreter), string_length);
if (interpreter.exception())
@ -358,7 +358,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::includes)
if (interpreter.exception())
return {};
// FIXME: position should index a UTF-16 codepoint view of the string.
// FIXME: position should index a UTF-16 code_point view of the string.
size_t position = 0;
if (interpreter.argument_count() >= 2) {
position = interpreter.argument(1).to_size_t(interpreter);
@ -385,7 +385,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::slice)
if (interpreter.argument_count() == 0)
return js_string(interpreter, string);
// FIXME: index_start and index_end should index a UTF-16 codepoint view of the string.
// FIXME: index_start and index_end should index a UTF-16 code_point view of the string.
auto string_length = static_cast<i32>(string.length());
auto index_start = interpreter.argument(0).to_i32(interpreter);
if (interpreter.exception())
@ -437,7 +437,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::last_index_of)
auto max_index = string.length() - search_string.length();
auto from_index = max_index;
if (interpreter.argument_count() >= 2) {
// FIXME: from_index should index a UTF-16 codepoint view of the string.
// FIXME: from_index should index a UTF-16 code_point view of the string.
from_index = min(interpreter.argument(1).to_size_t(interpreter), max_index);
if (interpreter.exception())
return {};

View file

@ -917,10 +917,10 @@ TriState abstract_relation(Interpreter& interpreter, bool left_first, Value lhs,
if (y_string.starts_with(x_string))
return TriState::True;
Utf8View x_codepoints { x_string };
Utf8View y_codepoints { y_string };
for (auto k = x_codepoints.begin(), l = y_codepoints.begin();
k != x_codepoints.end() && l != y_codepoints.end();
Utf8View x_code_points { x_string };
Utf8View y_code_points { y_string };
for (auto k = x_code_points.begin(), l = y_code_points.begin();
k != x_code_points.end() && l != y_code_points.end();
++k, ++l) {
if (*k != *l) {
if (*k < *l) {

View file

@ -136,7 +136,7 @@ String Token::string_value(StringValueStatus& status) const
auto digit2 = m_value[++i];
if (!isxdigit(digit1) || !isxdigit(digit2))
return encoding_failure(StringValueStatus::MalformedHexEscape);
builder.append_codepoint(hex2int(digit1) * 16 + hex2int(digit2));
builder.append_code_point(hex2int(digit1) * 16 + hex2int(digit2));
break;
}
case 'u': {
@ -174,7 +174,7 @@ String Token::string_value(StringValueStatus& status) const
}
}
builder.append_codepoint(code_point);
builder.append_code_point(code_point);
break;
}
default: