Skip to content

Commit

Permalink
dispatch @inc to @*INC
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Apr 2, 2013
1 parent 3d2cd1a commit bb0fa8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Perl6/P5Actions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,11 @@ class Perl6::P5Actions is HLL::Actions does STDActions {
@*UNQUOTE_ASTS.push($<statementlist>.ast);
}

method special_variable:sym<@INC>($/) {
$DEBUG && say("special_variable:sym<\@INC>($/)");
make QAST::Op.new( :op('call'), :name('&DYNAMIC'), $*W.add_string_constant('@*INC'))
}

method special_variable:sym<$0>($/) {
$DEBUG && say("special_variable:sym<\$0>($/)");
make QAST::Op.new( :op('call'), :name('&DYNAMIC'), $*W.add_string_constant('$*PROGRAM_NAME'))
Expand Down
4 changes: 4 additions & 0 deletions lib/Perl6/P5Grammar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,10 @@ grammar Perl6::P5Grammar is HLL::Grammar does STD5 {
'-'?<key=identifier> <?before \h* '=>' >
}

token special_variable:sym<@INC> {
<sym>
}

token special_variable:sym<$0> {
<sym> | '$PROGRAM_NAME'
}
Expand Down

0 comments on commit bb0fa8e

Please sign in to comment.