Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Catch double use of ;; in signature
  • Loading branch information
lizmat committed Jun 28, 2015
1 parent 89ff9b3 commit 947138f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -2580,7 +2580,14 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}

rule param_sep {
'' $<sep>=[','|':'|';;'|';'] { @*seps.push($<sep>) }
'' $<sep>=[','|':'|';;'|';'] {
if $<sep> eq ';;' {
$/.CURSOR.panic("Can only specify ';;' once in a signature")
if $*seen_semicoloncolon;
$*seen_semicoloncolon := 1;
}
@*seps.push($<sep>);
}
}

# XXX Not really implemented yet.
Expand All @@ -2602,6 +2609,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token signature {
:my $*IN_DECL := 'sig';
:my $*zone := 'posreq';
:my $*seen_semicoloncolon := 0;
:my @*seps := nqp::list();
:my $*INVOCANT_OK := 1;
<.ws>
Expand Down

0 comments on commit 947138f

Please sign in to comment.