Skip to content

Commit 2695eea

Browse files
committed
Implement ignorecase subtype in literal. Well, try to - for some reason it seems to need ICU, which I don't have to hand. :-( Testing and Rakudo version bump welcome from anyone who does.
1 parent 73e0060 commit 2695eea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/QAST/Compiler.nqp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,16 @@ class QAST::Compiler is HLL::Compiler {
248248
method literal($node) {
249249
my $ops := self.post_new('Ops');
250250
my $litconst := $node[0];
251+
$litconst := nqp::lc($litconst)
252+
if $node.subtype eq 'ignorecase';
251253
my $litlen := nqp::chars($litconst);
252254
my $litpost := self.escape($litconst);
253255
my $cmpop := $node.negate ?? 'eq' !! 'ne';
254256
$ops.push_pirop('add', '$I11', %*REG<pos>, $litlen);
255257
$ops.push_pirop('gt', '$I11', %*REG<eos>, %*REG<fail>);
256258
$ops.push_pirop('substr', '$S10', %*REG<tgt>, %*REG<pos>, $litlen);
259+
$ops.push_pirop('downcase', '$S10', '$S10')
260+
if $node.subtype eq 'ignorecase';
257261
$ops.push_pirop($cmpop, '$S10', $litpost, %*REG<fail>);
258262
$ops.push_pirop('add', %*REG<pos>, $litlen);
259263
$ops;

0 commit comments

Comments
 (0)