mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibURL/Pattern: Implement generating a component match result
This commit is contained in:
parent
e35555f00e
commit
2a44420e52
Notes:
github-actions[bot]
2025-04-06 12:27:13 +00:00
Author: https://github.com/shannonbooth
Commit: 2a44420e52
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3847
Reviewed-by: https://github.com/trflynn89
3 changed files with 55 additions and 16 deletions
|
@ -15,6 +15,16 @@ namespace URL::Pattern {
|
|||
|
||||
// https://urlpattern.spec.whatwg.org/#component
|
||||
struct Component {
|
||||
static PatternErrorOr<Component> compile(Utf8View const& input, PatternParser::EncodingCallback, Options const&);
|
||||
|
||||
// https://urlpattern.spec.whatwg.org/#dictdef-urlpatterncomponentresult
|
||||
struct Result {
|
||||
String input;
|
||||
OrderedHashMap<String, Variant<String, Empty>> groups;
|
||||
};
|
||||
|
||||
Result create_match_result(String const& input, regex::RegexResult const& exec_result) const;
|
||||
|
||||
// https://urlpattern.spec.whatwg.org/#component-pattern-string
|
||||
// pattern string, a well formed pattern string
|
||||
String pattern_string;
|
||||
|
@ -30,8 +40,6 @@ struct Component {
|
|||
// https://urlpattern.spec.whatwg.org/#component-has-regexp-groups
|
||||
// has regexp groups, a boolean
|
||||
bool has_regexp_groups {};
|
||||
|
||||
static PatternErrorOr<Component> compile(Utf8View const& input, PatternParser::EncodingCallback, Options const&);
|
||||
};
|
||||
|
||||
bool protocol_component_matches_a_special_scheme(Component const& protocol_component);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue