Skip to content

Commit

Permalink
Grammar.parse sets $/ in the caller's scope
Browse files Browse the repository at this point in the history
Also remove a failed attempt to set $/ in the closure passed to Str.subst
  • Loading branch information
moritz committed May 6, 2010
1 parent 9709f85 commit 7563a50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/core/Cool-str.pm
Expand Up @@ -31,7 +31,6 @@ augment class Cool {
return self;
}
loop (my $i = 1; $i < @chunks; $i += 2) {
pir::store_dynamic_lex__vSP('$/', @chunks[$i]);
@chunks[$i] = $replacement ~~ Callable ?? $replacement(@chunks[$i]) !! $replacement;
}
@chunks.join('');
Expand Down
4 changes: 3 additions & 1 deletion src/core/Grammar.pm
Expand Up @@ -9,7 +9,9 @@ class Grammar is Regex::Cursor {
if $action {
die(":action has been renamed to :actions in the Grammar.parse method")
}
nextwith($str, :$actions, |%options);
my $match = callwith($str, :$actions, |%options);
pir::store_dynamic_lex__vSP('$/', $match);
$match;
}
}

Expand Down

0 comments on commit 7563a50

Please sign in to comment.