1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:07:34 +00:00

LibJS: Port ListFormat and PatternPartition to String

This commit is contained in:
Timothy Flynn 2023-01-21 10:34:07 -05:00 committed by Linus Groh
parent 20536897e4
commit 1bcde5d216
10 changed files with 53 additions and 54 deletions

View file

@ -6,7 +6,6 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/HashMap.h>
#include <AK/String.h>
#include <AK/StringView.h>
@ -53,9 +52,9 @@ private:
using Placeables = HashMap<StringView, Variant<PatternPartition, Vector<PatternPartition>>>;
ThrowCompletionOr<Vector<PatternPartition>> deconstruct_pattern(VM&, StringView pattern, Placeables);
ThrowCompletionOr<Vector<PatternPartition>> create_parts_from_list(VM&, ListFormat const&, Vector<DeprecatedString> const& list);
ThrowCompletionOr<DeprecatedString> format_list(VM&, ListFormat const&, Vector<DeprecatedString> const& list);
ThrowCompletionOr<Array*> format_list_to_parts(VM&, ListFormat const&, Vector<DeprecatedString> const& list);
ThrowCompletionOr<Vector<DeprecatedString>> string_list_from_iterable(VM&, Value iterable);
ThrowCompletionOr<Vector<PatternPartition>> create_parts_from_list(VM&, ListFormat const&, Vector<String> const& list);
ThrowCompletionOr<String> format_list(VM&, ListFormat const&, Vector<String> const& list);
ThrowCompletionOr<Array*> format_list_to_parts(VM&, ListFormat const&, Vector<String> const& list);
ThrowCompletionOr<Vector<String>> string_list_from_iterable(VM&, Value iterable);
}