mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 16:55:09 +00:00
LibRegex: Make codegen+optimisation for alternatives much faster
Just a little thinking outside the box, and we can now parse and optimise a million copies of "a|" chained together in just a second :^)
This commit is contained in:
parent
4be7239626
commit
97a333608e
5 changed files with 150 additions and 65 deletions
|
@ -14,6 +14,7 @@ namespace regex {
|
|||
class Optimizer {
|
||||
public:
|
||||
static void append_alternation(ByteCode& target, ByteCode&& left, ByteCode&& right);
|
||||
static void append_alternation(ByteCode& target, Span<ByteCode> alternatives);
|
||||
static void append_character_class(ByteCode& target, Vector<CompareTypeAndValuePair>&& pairs);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue