Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix failure to scream to the high heavens about certain redeclarations.
  • Loading branch information
jnthn committed Oct 2, 2011
1 parent 1f1df92 commit 8b07dd1
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/Perl6/Grammar.pm
Expand Up @@ -1188,8 +1188,8 @@ grammar Perl6::Grammar is HLL::Grammar {
# variants are OK) or else an illegal redecl.
if $exists && $*PKGDECL ne 'role' {
if $*PACKAGE.HOW.is_composed($*PACKAGE) {
$/.CURSOR.panic("Illegal redeclaration of $*PKGDECL '" ~
~$longname<name> ~ "'");
$/.CURSOR.panic("Illegal redeclaration of symbol " ~
~$longname<name>);
}
}

Expand Down Expand Up @@ -1650,6 +1650,13 @@ grammar Perl6::Grammar is HLL::Grammar {
<sym> <.ws>
[
| <longname>
{
my @name := parse_name(~$<longname><name>);
if $*ST.already_declared($*SCOPE, $*PACKAGE, $*ST.cur_lexpad(), @name) {
$/.CURSOR.panic("Illegal redeclaration of symbol " ~
~$<longname><name>);
}
}
| <variable>
| <?>
]
Expand All @@ -1665,7 +1672,16 @@ grammar Perl6::Grammar is HLL::Grammar {
:s
[
[
[ <longname> ]?
[
<longname>
{
my @name := parse_name(~$<longname><name>);
if $*ST.already_declared($*SCOPE, $*PACKAGE, $*ST.cur_lexpad(), @name) {
$/.CURSOR.panic("Illegal redeclaration of symbol " ~
~$<longname><name>);
}
}
]?
{ $*IN_DECL := '' }
<trait>*
[ where <EXPR('e=')> ]?
Expand Down

0 comments on commit 8b07dd1

Please sign in to comment.