summaryrefslogtreecommitdiff
path: root/Meta
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-03-01 16:28:32 +0100
committerLinus Groh <mail@linusgroh.de>2023-03-13 15:16:20 +0000
commit80327245742a13a736974797ba8a511f9eff2d4b (patch)
treea2b039ba726291e47af517811b75c0320c484477 /Meta
parente0072793151ec3f44080219640e3d6c3144bb8f5 (diff)
downloadserenity-80327245742a13a736974797ba8a511f9eff2d4b.zip
CodeGenerators: Ensure that we always print the entire generated output
Diffstat (limited to 'Meta')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp9
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMediaFeatureID.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp6
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWindowOrWorkerInterfaces.cpp12
17 files changed, 37 insertions, 74 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp b/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp
index 0e6f1be97e..f497087261 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp
@@ -211,8 +211,7 @@ namespace PnpIDs {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -266,8 +265,7 @@ IterationDecision for_each(Function<IterationDecision(PnpIDData const&)> callbac
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp b/Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp
index f7a81af8f8..3ece80aa63 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp
@@ -405,8 +405,7 @@ ErrorOr<void> generate_header_file(JsonObject& api_data, Core::File& file)
generator.appendln("}");
generator.appendln("#endif");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -530,8 +529,7 @@ ErrorOr<void> generate_implementation_file(JsonObject& api_data, Core::File& fil
}
});
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp
index 11036568e7..463dea1deb 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp
@@ -1724,8 +1724,7 @@ namespace Locale {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -2398,8 +2397,7 @@ Optional<StringView> get_time_zone_name(StringView locale, StringView time_zone,
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp
index 9aaa0e2aa8..c046530860 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp
@@ -1047,8 +1047,7 @@ namespace Locale {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -1748,8 +1747,7 @@ ErrorOr<Optional<String>> resolve_most_likely_territory(LanguageID const& langua
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp
index c256207909..194cfef899 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp
@@ -763,8 +763,7 @@ namespace Locale {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -1108,8 +1107,7 @@ ErrorOr<Vector<NumberFormat>> get_unit_formats(StringView locale, StringView uni
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp
index 06cf4e5233..ff13b336fa 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp
@@ -442,8 +442,7 @@ namespace Locale {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -655,8 +654,7 @@ PluralCategory determine_plural_range(StringView locale, PluralCategory start, P
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
index 2de3325cfc..f00b7d49be 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
@@ -180,8 +180,7 @@ namespace Locale {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -277,8 +276,7 @@ ErrorOr<Vector<RelativeTimeFormat>> get_relative_time_format_patterns(StringView
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp
index bfce2109e4..a9f7d60467 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp
@@ -469,8 +469,7 @@ namespace TimeZone {
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -802,8 +801,7 @@ Vector<StringView> time_zones_in_region(StringView region)
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp
index f767e359b4..b9be27ce79 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp
@@ -213,8 +213,7 @@ static ErrorOr<void> generate_emoji_data_header(Core::BufferedFile& file, EmojiD
StringBuilder builder;
SourceGenerator generator { builder };
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -335,8 +334,7 @@ Optional<Emoji> find_emoji_for_code_points(ReadonlySpan<u32> code_points)
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -381,8 +379,7 @@ static ErrorOr<void> generate_emoji_installation(Core::BufferedFile& file, Emoji
generator.append(" @name@ (@status@)\n"sv);
}
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp
index bc9ae3545c..a229ea8238 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp
@@ -866,8 +866,7 @@ ReadonlySpan<CaseFolding const*> case_folding_mapping(u32 code_point);
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -1355,8 +1354,7 @@ bool code_point_has_@enum_snake@(u32 code_point, @enum_title@ @enum_snake@)
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp
index 7380ff753f..f48fe9ffae 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp
@@ -160,8 +160,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (global_mixin_implementation_mode)
IDL::generate_global_mixin_implementation(interface, output_builder);
- // FIXME: This should write the entire span.
- TRY(output_file->write_some(output_builder.string_view().bytes()));
+ TRY(output_file->write_until_depleted(output_builder.string_view().bytes()));
if (!depfile_path.is_null()) {
auto depfile = TRY(Core::File::open_file_or_standard_stream(depfile_path, Core::File::OpenMode::Write));
@@ -174,8 +173,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
depfile_builder.append(path);
}
depfile_builder.append('\n');
- // FIXME: This should write the entire span.
- TRY(depfile->write_some(depfile_builder.string_view().bytes()));
+ TRY(depfile->write_until_depleted(depfile_builder.string_view().bytes()));
}
return 0;
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp
index 3b69be6a23..81f326d685 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp
@@ -95,8 +95,7 @@ enum class ValueID;
generator.appendln("}");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -200,7 +199,6 @@ StringView to_string(@name:titlecase@ value)
generator.appendln("}");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMediaFeatureID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMediaFeatureID.cpp
index dac67bc14e..7e40a39313 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMediaFeatureID.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMediaFeatureID.cpp
@@ -80,8 +80,7 @@ bool media_feature_accepts_identifier(MediaFeatureID, ValueID);
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -291,7 +290,6 @@ bool media_feature_accepts_identifier(MediaFeatureID media_feature_id, ValueID i
}
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp
index 5dee887262..6606f255b7 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp
@@ -140,8 +140,7 @@ struct Traits<Web::CSS::PropertyID> : public GenericTraits<Web::CSS::PropertyID>
} // namespace AK
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -606,7 +605,6 @@ size_t property_maximum_value_count(PropertyID property_id)
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp
index 7e4cea8284..efa3075b19 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp
@@ -96,8 +96,7 @@ TransformFunctionMetadata transform_function_metadata(TransformFunction);
generator.appendln("\n}");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -206,7 +205,6 @@ TransformFunctionMetadata transform_function_metadata(TransformFunction transfor
generator.appendln("\n}");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp
index 2b0c51b485..7d2642608a 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp
@@ -74,8 +74,7 @@ StringView string_from_value_id(ValueID);
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -135,7 +134,6 @@ StringView string_from_value_id(ValueID value_id) {
} // namespace Web::CSS
)~~~");
- // FIXME: This should write the entire span.
- TRY(file.write_some(generator.as_string_view().bytes()));
+ TRY(file.write_until_depleted(generator.as_string_view().bytes()));
return {};
}
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWindowOrWorkerInterfaces.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWindowOrWorkerInterfaces.cpp
index ab6ddc0314..29cb6df08d 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWindowOrWorkerInterfaces.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWindowOrWorkerInterfaces.cpp
@@ -105,8 +105,7 @@ class @legacy_constructor_class@;)~~~");
auto generated_forward_path = LexicalPath(output_path).append("Forward.h"sv).string();
auto generated_forward_file = TRY(Core::File::open(generated_forward_path, Core::File::OpenMode::Write));
- // FIXME: This should write the entire span.
- TRY(generated_forward_file->write_some(generator.as_string_view().bytes()));
+ TRY(generated_forward_file->write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -209,8 +208,7 @@ void Intrinsics::create_web_prototype_and_constructor<@prototype_class@>(JS::Rea
auto generated_intrinsics_path = LexicalPath(output_path).append("IntrinsicDefinitions.cpp"sv).string();
auto generated_intrinsics_file = TRY(Core::File::open(generated_intrinsics_path, Core::File::OpenMode::Write));
- // FIXME: This should write the entire span.
- TRY(generated_intrinsics_file->write_some(generator.as_string_view().bytes()));
+ TRY(generated_intrinsics_file->write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -236,8 +234,7 @@ void add_@global_object_snake_name@_exposed_interfaces(JS::Object&);
auto generated_header_path = LexicalPath(output_path).append(DeprecatedString::formatted("{}ExposedInterfaces.h", class_name)).string();
auto generated_header_file = TRY(Core::File::open(generated_header_path, Core::File::OpenMode::Write));
- // FIXME: This should write the entire span.
- TRY(generated_header_file->write_some(generator.as_string_view().bytes()));
+ TRY(generated_header_file->write_until_depleted(generator.as_string_view().bytes()));
return {};
}
@@ -306,8 +303,7 @@ void add_@global_object_snake_name@_exposed_interfaces(JS::Object& global)
auto generated_implementation_path = LexicalPath(output_path).append(DeprecatedString::formatted("{}ExposedInterfaces.cpp", class_name)).string();
auto generated_implementation_file = TRY(Core::File::open(generated_implementation_path, Core::File::OpenMode::Write));
- // FIXME: This should write the entire span.
- TRY(generated_implementation_file->write_some(generator.as_string_view().bytes()));
+ TRY(generated_implementation_file->write_until_depleted(generator.as_string_view().bytes()));
return {};
}