Skip to content

Instantly share code, notes, and snippets.

@uasi
Created December 15, 2010 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uasi/742122 to your computer and use it in GitHub Desktop.
Save uasi/742122 to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Grammar.pm b/src/Perl6/Grammar.pm
index 93b73c0..5f0c8b2 100644
--- a/src/Perl6/Grammar.pm
+++ b/src/Perl6/Grammar.pm
@@ -860,8 +860,9 @@ rule package_def {
$/.CURSOR.panic('This appears to be Perl 5 code. If you intended it to be Perl 6 code, please use a Perl 6 style package block like "package Foo { ... }", or "module Foo; ...".');
}
}
+ { $*IN_DECL := '' }
<statementlist>
- || <?[{]> <blockoid>
+ || <?[{]> { $*IN_DECL := '' } <blockoid>
|| <.panic: 'Malformed package declaration'>
]
}
@@ -1188,6 +1189,7 @@ token type_declarator:sym<subset> {
[
[
[ <longname> { $/.CURSOR.add_name($<longname>[0].Str); } ]?
+ { $*IN_DECL := '' }
<trait>*
[ where <EXPR('e=')> ]?
]
@uasi
Copy link
Author

uasi commented Dec 15, 2010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment