Skip to content

Commit

Permalink
Further refactoring of unitstart and outer lexical handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jul 5, 2010
1 parent 7bdeadf commit a7c6953
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/Perl6/Actions.pm
Expand Up @@ -136,7 +136,15 @@ method comp_unit($/, $key?) {
}

method unitstart($/) {
# Create a block for the compilation unit.
self.newpad($/);
# Use SET_BLOCK_OUTER_CTX (inherited from HLL::Actions)
# to set dynamic outer lexical context and namespace details
# for the compilation unit.
self.SET_BLOCK_OUTER_CTX(@BLOCK[0]);

self.newpad($/);
self.finishpad($/);
}

method statementlist($/) {
Expand Down Expand Up @@ -284,12 +292,6 @@ method newpad($/) {
@BLOCK.unshift($new_block);
}

method outerlex($/) {
# Use SET_BLOCK_OUTER_CTX (inherited from HLL::Actions)
# to set dynamic outer lexical context and namespace details
# for the compilation unit.
self.SET_BLOCK_OUTER_CTX(@BLOCK[0]);
}

method finishpad($/) {
# Generate the $_, $/, and $! lexicals if they aren't already
Expand Down
2 changes: 0 additions & 2 deletions src/Perl6/Grammar.pm
Expand Up @@ -282,7 +282,6 @@ token comp_unit {
:my $*UNITPAST;
<.unitstart>
<.newpad>
<.outerlex>
<.finishpad>
{*} #= open
<statementlist>
Expand Down Expand Up @@ -360,7 +359,6 @@ token blockoid {

token unitstart { <?> }
token newpad { <?> }
token outerlex { <?> }
token finishpad { <?> }

proto token terminator { <...> }
Expand Down

0 comments on commit a7c6953

Please sign in to comment.