Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
protect "grammar" etc with <.end_keyword>
cognominal++ noted that it is applied too late (after the package_declarator:sym<...>
action method has fired)
  • Loading branch information
moritz committed Oct 26, 2011
1 parent a4602de commit 158bd07
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Perl6/Grammar.pm
Expand Up @@ -1093,42 +1093,42 @@ grammar Perl6::Grammar is HLL::Grammar {
token package_declarator:sym<package> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'package';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<module> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'module';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<class> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'class';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<grammar> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'grammar';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<role> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'role';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<knowhow> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'knowhow';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<native> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'native';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<slang> {
:my $*OUTERPACKAGE := $*PACKAGE;
:my $*PKGDECL := 'slang';
<sym> <package_def>
<sym> <.end_keyword> <package_def>
}
token package_declarator:sym<trusts> {
<sym> <.ws> <typename>
Expand All @@ -1138,7 +1138,7 @@ grammar Perl6::Grammar is HLL::Grammar {
[ <trait>+ || <.panic: "No valid trait found after also"> ]
}

rule package_def {<.end_keyword>
rule package_def {
:my $longname;
:my $outer := $*ST.cur_lexpad();
:my $*DECLARAND;
Expand Down

0 comments on commit 158bd07

Please sign in to comment.