Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Localize %*LANG and %*HOW in statementlist.
This means that custom meta-objects really do only apply in the lexical
scope that they are imported into.
  • Loading branch information
jnthn committed Oct 16, 2012
1 parent 0d7f83c commit dbd8130
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -583,8 +583,20 @@ grammar Perl6::Grammar is HLL::Grammar {
}

rule statementlist {
:my %*LANG := self.shallow_copy(pir::find_dynamic_lex__Ps('%*LANG'));
:my %*HOW := self.shallow_copy(pir::find_dynamic_lex__Ps('%*HOW'));
[
| $
| [<statement><.eat_terminator> ]*
]
}

method shallow_copy(%hash) {
my %result;
for %hash {
%result{$_.key} := $_.value;
}
%result
}

rule semilist {
Expand Down

0 comments on commit dbd8130

Please sign in to comment.