Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

return Nil for a failed match

  • Loading branch information...
commit 61c623e7e4ee397a0dbd6ee7deedb9d17baa370f 1 parent 80f798b
Tobias Leich FROGGS authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 src/core/Cursor.pm
4 src/core/Cursor.pm
@@ -42,7 +42,7 @@ my class Cursor does NQPCursorRole {
42 42 method MATCH_SAVE() {
43 43 my $match := self.MATCH();
44 44 $last_match := $match if $match;
45   - $match;
  45 + $match || Nil
46 46 }
47 47
48 48 # INTERPOLATE will iterate over the string $tgt beginning at position 0.
@@ -79,7 +79,7 @@ my class Cursor does NQPCursorRole {
79 79 $match := nqp::substr($tgt, $pos, $eos - $pos) ~~ $topic;
80 80 # In order to return the correct result we need to match from the
81 81 # current position only.
82   - next if $match.from;
  82 + next if !$match || $match.from;
83 83 $match := ~$match;
84 84 $len := nqp::chars( $match );
85 85 }

0 comments on commit 61c623e

Please sign in to comment.
Something went wrong with that request. Please try again.