Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make 'use attributes' work as designed
  • Loading branch information
lizmat committed Oct 8, 2015
1 parent 6f65c36 commit f931261
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -2314,7 +2314,19 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
|| <?{ $*SCOPE eq 'has' }> <.newpad>
[
|| <.ws> <initializer>
|| <?{ $*OFTYPE<colonpairs><D> }> { self.typed_panic: "X::Syntax::Variable::MissingInitializer", type => ~$*OFTYPE }
|| { my $colonpairs := $*OFTYPE<colonpairs>;
if $colonpairs<D> {
self.typed_panic: "X::Syntax::Variable::MissingInitializer", type => ~$*OFTYPE;
}
elsif $colonpairs<U> || $colonpairs<_> {
}
elsif %*PRAGMAS<attributes> -> $default {
if $default eq 'D' {
self.typed_panic: "X::Syntax::Variable::MissingInitializer", type => ~$*OFTYPE ~ ' (with implicit :D)';
}
}
1;
}
]? { $*ATTR_INIT_BLOCK := $*W.pop_lexpad() }
|| <.ws> <initializer>
|| <?{ $*OFTYPE<colonpairs><D> }> { self.typed_panic: "X::Syntax::Variable::MissingInitializer", type => ~$*OFTYPE }
Expand Down

0 comments on commit f931261

Please sign in to comment.