Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add __PACKAGE__, not perfect yet though
  • Loading branch information
FROGGS committed Mar 30, 2013
1 parent 197949f commit 206cb36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Perl6/P5Actions.pm
Expand Up @@ -3836,6 +3836,12 @@ class Perl6::P5Actions is HLL::Actions does STDActions {
make $*W.add_string_constant(nqp::getlexdyn('$?FILES') // '<unknown file>');
}

method term:sym<__PACKAGE__>($/) {
$DEBUG && say("term:sym<__PACKAGE__>($/)");
# TODO stringify to 'main' for (GLOBAL)
make QAST::Var.new( :name('$?PACKAGE'), :scope('lexical') );
}

sub make_yada($name, $/) {
my $past := $<args>.ast;
$past.name($name);
Expand Down
3 changes: 3 additions & 0 deletions lib/Perl6/P5Grammar.pm
Expand Up @@ -3367,6 +3367,9 @@ grammar Perl6::P5Grammar is HLL::Grammar does STD5 {
token term:sym<__FILE__> {
<sym>
}
token term:sym<__PACKAGE__> {
<sym>
}

# token term:sym<rmdir>
# { <sym> » <?before \s*> <.ws> <EXPR('q=')>? }
Expand Down

0 comments on commit 206cb36

Please sign in to comment.