Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - create $Perlito5::PHASE
  • Loading branch information
fglock committed Oct 14, 2014
1 parent 89bf744 commit 9b70863
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions perlito5.pl
Expand Up @@ -5461,6 +5461,7 @@ sub Perlito5::Grammar::Block::term_block {
if (ref($v) eq 'Perlito5::AST::Lit::Block') {
if ($block_name eq 'BEGIN') {
local $Perlito5::PKG_NAME = $Perlito5::PKG_NAME;
local $Perlito5::PHASE = 'BEGIN';
eval(substr($str, $block_start, $m->{'to'} - $block_start));
$m->{'capture'} = Perlito5::AST::Apply->new('code' => 'undef', 'namespace' => '', 'arguments' => [])
}
Expand Down
1 change: 1 addition & 0 deletions src5/lib/Perlito5/Grammar/Block.pm
Expand Up @@ -81,6 +81,7 @@ sub term_block {
if ($block_name eq 'BEGIN') {
# say "BEGIN $block_start ", $m->{to}, "[", substr($str, $block_start, $m->{to} - $block_start), "]";
local $Perlito5::PKG_NAME = $Perlito5::PKG_NAME;
local $Perlito5::PHASE = 'BEGIN';
eval substr($str, $block_start, $m->{to} - $block_start);
$m->{capture} =
Perlito5::AST::Apply->new(
Expand Down

0 comments on commit 9b70863

Please sign in to comment.