LibURL/Pattern: Implement ability to compile a component

This provides the infrastructure for taking a part list from the
pattern parser and generating the actual regexp object which is
used for matching against URLs from the pattern.
This commit is contained in:
Shannon Booth 2025-03-18 19:34:25 +13:00 committed by Tim Flynn
commit c9e6ad562c
Notes: github-actions[bot] 2025-04-06 12:27:29 +00:00
3 changed files with 261 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <AK/OwnPtr.h>
#include <AK/String.h>
#include <LibRegex/Regex.h>
#include <LibURL/Pattern/PatternParser.h>
namespace URL::Pattern {
@ -29,6 +30,8 @@ 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&);
};
}