Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Parse $/ and $¢
  • Loading branch information
sorear committed Aug 23, 2010
1 parent 36e966d commit 862b2be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Niecza/Actions.pm
Expand Up @@ -54,7 +54,9 @@ sub REDUCE {
};

if ($@) {
$M->sorry($@);
my $foo = $@;
$foo =~ s/^(?:[^\n]*\n){5}\K.*//s;
$M->sorry($foo);
}
}

Expand Down Expand Up @@ -1396,6 +1398,8 @@ sub variable { my ($cl, $M) = @_;
$name = $M->{name}[0]{_ast}{names}[0];
$twigil = ':';
}
} elsif ($M->{special_variable}) {
$name = substr($M->{special_variable}->Str, 1);
} else {
$M->sorry("Non-simple variables NYI");
return;
Expand All @@ -1406,6 +1410,10 @@ sub variable { my ($cl, $M) = @_;
};
}

sub special_variable {}
sub special_variable__S_DollarSlash {}
sub special_variable__S_Dollar_a2_ {}

sub param_sep {}

# :: { list : Bool, hash : Bool slot : Maybe[Str], names : [Str] }
Expand Down
5 changes: 5 additions & 0 deletions test2.pl
Expand Up @@ -14,4 +14,9 @@
$a = 5;
is $b, 2, "ro binding loses original container";

ok 'xxy' ~~ /x { $a = $/.pos } /, "can match with \$/ stuff";
is $a, 1, '$/.pos is the right sort of thing';
'xxy' ~~ /x { $a = ($¢ ~~ Cursor) }/;
is $a, True, '$¢ isa Cursor';

done-testing;

0 comments on commit 862b2be

Please sign in to comment.