Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

:continue and :pos now default to ($/ ?? $/.to !! 0)

  • Loading branch information...
commit 69561ef449a81aee22189229e9724ea23565e6ee 1 parent 6b318ea
@moritz moritz authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/Perl6/Actions.pm
View
16 src/Perl6/Actions.pm
@@ -2685,7 +2685,21 @@ INIT {
method quotepair($/) {
unless $*value ~~ PAST::Node {
- $*value := PAST::Val.new( :value($*value) );
+ if ($*key eq 'c' || $*key eq 'continue'
+ || $*key eq 'p' || $*key eq 'pos') && $*value == 1 {
+ $*value := PAST::Op.new(
+ :node($/),
+ :pasttype<if>,
+ PAST::Var.new(:name('$/'), :scope('lexical')),
+ PAST::Op.new(:pasttype('callmethod'),
+ PAST::Var.new(:name('$/'), :scope<lexical>),
+ :name<to>
+ ),
+ PAST::Val.new(:value(0)),
+ );
+ } else {
+ $*value := PAST::Val.new( :value($*value) );
+ }
}
$*value.named(~$*key);
make $*value;
Please sign in to comment.
Something went wrong with that request. Please try again.