Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify installation part of constant action method to re-use more S…
…ymbolTable code.
  • Loading branch information
jnthn committed Aug 8, 2011
1 parent af72bd3 commit 1701656
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/Perl6/Actions.pm
Expand Up @@ -1746,16 +1746,8 @@ class Perl6::Actions is HLL::Actions {
}

# Install.
if $*SCOPE eq '' || $*SCOPE eq 'our' {
$*ST.install_lexical_symbol($*ST.cur_lexpad(), $name, $value);
$*ST.install_package_symbol($*PACKAGE, $name, $value);
}
elsif $*SCOPE eq 'my' {
$*ST.install_lexical_symbol($*ST.cur_lexpad(), $name, $value);
}
else {
$/.CURSOR.panic("$*SCOPE scoped constants are not yet implemented");
}
$*ST.install_package($/, [$name], ($*SCOPE || 'our'),
'constant', $*PACKAGE, $*ST.cur_lexpad(), $value);

# Evaluate to the constant.
return $*ST.get_object_sc_ref_past($value);
Expand Down

0 comments on commit 1701656

Please sign in to comment.