@@ -661,9 +661,19 @@ class QAST::MASTRegexCompiler {
661
661
op($ op , $ s0 , % ! reg <zero >, sval(nqp :: lc ($ c ) ~ nqp :: uc ($ c )), % ! reg <fail >),
662
662
]);
663
663
}
664
+ elsif $ node . subtype eq ' ignorecase' {
665
+ # XXX ignorecase may want fc instead of lc
666
+ my $ cmpop := $ node . negate ?? ' if_i' !! ' unless_i' ;
667
+ nqp :: push (@ ins , op(' const_s' , $ s0 , sval(nqp :: lc ($ litconst ))));
668
+ unless nqp ::existskey(% ! reg , ' haystacklc' ) {
669
+ % ! reg <haystacklc > := $ ! regalloc . fresh_s();
670
+ nqp :: push (@ ins , op(' lc' , % ! reg <haystacklc >, % ! reg <tgt >));
671
+ }
672
+ nqp :: push (@ ins , op(' eqat_s' , $ i0 , % ! reg <haystacklc >, $ s0 , % ! reg <pos >));
673
+ nqp :: push (@ ins , op($ cmpop , $ i0 , % ! reg <fail >));
674
+ }
664
675
else {
665
- my $ eq_op := $ node . subtype eq ' ignorecase' ?? ' eqatic_s' !!
666
- $ node . subtype eq ' ignoremark' ?? ' eqatim_s' !! ' eqat_s' ;
676
+ my $ eq_op := $ node . subtype eq ' ignoremark' ?? ' eqatim_s' !! ' eqat_s' ;
667
677
my $ cmpop := $ node . negate ?? ' if_i' !! ' unless_i' ;
668
678
nqp :: push (@ ins , op(' const_s' , $ s0 , sval($ litconst )));
669
679
nqp :: push (@ ins , op($ eq_op , $ i0 , % ! reg <tgt >, $ s0 , % ! reg <pos >));
0 commit comments