Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update setting with fix for failing subst expression.

  • Loading branch information...
commit 0e0dbcb29a2aa4c97db69a515bf06533cc940df4 1 parent 7882ea3
@pmichaud pmichaud authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/setting/Regex.pm
View
10 src/setting/Regex.pm
@@ -41,10 +41,12 @@ our sub subst ($text, $regex, $repl, :$global?) {
my $result := pir::new__Ps('StringBuilder');
for @matches -> $match {
- pir::push($result, pir::substr($text, $offset, $match.from - $offset))
- if $match.from > $offset;
- pir::push($result, $is_code ?? $repl($match) !! $repl);
- $offset := $match.to;
+ if $match {
+ pir::push($result, pir::substr($text, $offset, $match.from - $offset))
+ if $match.from > $offset;
+ pir::push($result, $is_code ?? $repl($match) !! $repl);
+ $offset := $match.to;
+ }
}
my $chars := pir::length($text);
Please sign in to comment.
Something went wrong with that request. Please try again.