Skip to content

Commit

Permalink
return Nil for a failed match
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Feb 24, 2013
1 parent 80f798b commit 61c623e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Cursor.pm
Expand Up @@ -42,7 +42,7 @@ my class Cursor does NQPCursorRole {
method MATCH_SAVE() {
my $match := self.MATCH();
$last_match := $match if $match;
$match;
$match || Nil
}

# INTERPOLATE will iterate over the string $tgt beginning at position 0.
Expand Down Expand Up @@ -79,7 +79,7 @@ my class Cursor does NQPCursorRole {
$match := nqp::substr($tgt, $pos, $eos - $pos) ~~ $topic;
# In order to return the correct result we need to match from the
# current position only.
next if $match.from;
next if !$match || $match.from;
$match := ~$match;
$len := nqp::chars( $match );
}
Expand Down

0 comments on commit 61c623e

Please sign in to comment.