Skip to content

Commit

Permalink
Quick crack at non-literal constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Mar 1, 2012
1 parent 2aa69ed commit 455035f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Perl6/Actions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2239,8 +2239,9 @@ class Perl6::Actions is HLL::Actions {
$value := $value_ast<compile_time_value>;
}
else {
my $name := ~($<identifier> // $<variable>);
$/.CURSOR.panic("Cannot handle constant $name with non-literal value yet");
my $value_thunk := make_thunk($value_ast, $/);
$value := $value_thunk();
$*W.add_constant_folded_result($value);
}

# Provided it's named, install it.
Expand Down

0 comments on commit 455035f

Please sign in to comment.