Permalink
Browse files

Make !LITERAL support getting a flag to match cAsE InSenSitiVE.

  • Loading branch information...
jnthn committed Apr 21, 2012
1 parent 0f16cba commit 655049ef5483f46d1620405eb0e85648a9f52fd7
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/QRegex/Cursor.nqp
View
@@ -203,11 +203,13 @@ role NQPCursorRole {
$cur;
}
- method !LITERAL($str) {
+ method !LITERAL($str, $i = 0) {
my $cur := self."!cursor_start"();
my $litlen := nqp::chars($str);
$cur."!cursor_pass"($!pos + $litlen)
- if nqp::substr($!target, $!pos, $litlen) eq $str;
+ if $i
+ ?? nqp::lc(nqp::substr($!target, $!pos, $litlen)) eq nqp::lc($str)
+ !! nqp::substr($!target, $!pos, $litlen) eq $str;
$cur;
}

0 comments on commit 655049e

Please sign in to comment.