Skip to content

Commit

Permalink
Implement \$\d+ syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Aug 23, 2010
1 parent f61a6db commit 5b403a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Niecza/Actions.pm
Expand Up @@ -1411,6 +1411,14 @@ sub variable { my ($cl, $M) = @_;
}
} elsif ($M->{special_variable}) {
$name = substr($M->{special_variable}->Str, 1);
} elsif ($M->{index}) {
$M->{_ast} = { term =>
# maybe a little of a cheat
$M->{_ast} = Op::CallMethod->new(node($M), name => 'at-pos',
receiver => Op::Lexical->new(name => '$/'),
positionals => [ Op::Num->new(value => $M->{index}{_ast}) ])
};
return;
} elsif ($M->{postcircumfix}[0]) {
if ($M->{postcircumfix}[0]{sym} eq '< >') {
$M->{_ast} = { term =>
Expand All @@ -1425,6 +1433,7 @@ sub variable { my ($cl, $M) = @_;
return;
}
} else {
say join " ", %$M;
$M->sorry("Non-simple variables NYI");
return;
}
Expand Down

0 comments on commit 5b403a4

Please sign in to comment.