Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
optimize the topmost regex node as well ...
  • Loading branch information
timo committed Nov 23, 2013
1 parent b7e33f0 commit 1d3e6b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/QRegex/P6Regex/Optimizer.nqp
Expand Up @@ -3,7 +3,15 @@ class QRegex::Optimizer {

method optimize($node, $outer, *%adverbs) {
my @!outer := [$outer];
self.visit_children($node);
my $type := $node.rxtype;
if $type eq 'concat' {
return self.visit_concat($node);
} elsif $type eq 'subrule' {
return self.simplify_assertion($node);
} else {
self.visit_children($node);
}
$node
}

method all_subtypes($node, $type) {
Expand Down

0 comments on commit 1d3e6b1

Please sign in to comment.