Skip to content

Commit

Permalink
Fix over-eager regex concat optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Dec 30, 2014
1 parent 614f229 commit b924e93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/QRegex/P6Regex/Actions.nqp
Expand Up @@ -59,7 +59,8 @@ class QRegex::P6Regex::Actions is HLL::Actions {
my $ast := $_.ast;
if $ast {
if $lastlit && $ast.rxtype eq 'literal'
&& !QAST::Node.ACCEPTS($ast[0]) {
&& !QAST::Node.ACCEPTS($ast[0])
&& $lastlit.subtype eq $ast.subtype {
$lastlit[0] := $lastlit[0] ~ $ast[0];
}
else {
Expand Down
1 change: 1 addition & 0 deletions t/qregex/rx_modifiers
Expand Up @@ -25,6 +25,7 @@
# todo :pugs<feature>
:1i bcd aBCDef y ignorecase, repetition (:1i)
:1i bcd aBxDef n ignorecase, repetition (:1i)
A :i B Ab y ignorecase in the middle, literals on both sides
ab [:i cd ] ef abcdef y ignorecase, lexical (:i)
ab [:i cd ] ef abCdef y ignorecase, lexical (:i)
ab [:i cd ] ef abcDef y ignorecase, lexical (:i)
Expand Down

0 comments on commit b924e93

Please sign in to comment.