Skip to content

Commit

Permalink
awesomize error message for regexes in packages a bit (though allowin…
Browse files Browse the repository at this point in the history
…g them would really be preferrable)
  • Loading branch information
moritz committed Mar 9, 2010
1 parent e42042c commit 5b81dfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Compiler/Module.pm
Expand Up @@ -2,7 +2,7 @@ class Perl6::Compiler::Module is Perl6::Compiler::Package;

# Modules don't support methods.
method methods() {
pir::die('You can not add a method to a module; use a class or role');
pir::die('You can not add a ' ~ $*METHODTYPE ~ ' to a module; use a class, role or grammar ');
}

# Accessor for attributes hash.
Expand Down
3 changes: 3 additions & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -763,14 +763,17 @@ rule post_constraint {
proto token regex_declarator { <...> }
token regex_declarator:sym<rule> {
<sym> {*} #= open
:my $*METHODTYPE := 'rule';
<regex_def>
}
token regex_declarator:sym<token> {
<sym> {*} #= open
:my $*METHODTYPE := 'token';
<regex_def>
}
token regex_declarator:sym<regex> {
<sym> {*} #= open
:my $*METHODTYPE := 'regex';
<regex_def>
}

Expand Down

0 comments on commit 5b81dfe

Please sign in to comment.