Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement parsing of $<foo> form
  • Loading branch information
sorear committed Aug 23, 2010
1 parent 862b2be commit eb16e02
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Niecza/Actions.pm
Expand Up @@ -1321,6 +1321,10 @@ sub term__S_fatarrow { my ($cl, $M) = @_;
}

sub do_variable_reference { my ($cl, $M, $v) = @_;
if ($v->{term}) {
return $v->{term};
}

my $sl = $v->{sigil} . $v->{twigil} . $v->{name};

if ($v->{rest} && $v->{twigil} =~ /[*=~?^:]/) {
Expand Down Expand Up @@ -1400,6 +1404,19 @@ sub variable { my ($cl, $M) = @_;
}
} elsif ($M->{special_variable}) {
$name = substr($M->{special_variable}->Str, 1);
} elsif ($M->{postcircumfix}[0]) {
if ($M->{postcircumfix}[0]{sym} eq '< >') {
$M->{_ast} = { term =>
# maybe a little of a cheat
$M->{_ast} = Op::CallMethod->new(node($M), name => 'at-key',
receiver => Op::Lexical->new(name => '$/'),
positionals => $M->{postcircumfix}[0]{_ast}{args})
};
return;
} else {
$M->sorry("Contextualizer variables NYI");
return;
}
} else {
$M->sorry("Non-simple variables NYI");
return;
Expand Down

0 comments on commit eb16e02

Please sign in to comment.