We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b40895c commit e6663bbCopy full SHA for e6663bb
src/NQP/Grammar.pm
@@ -311,8 +311,26 @@ token package_declarator:sym<native> {
311
}
312
313
rule package_def {
314
+ :my $*PKGMETA; # The meta-object for this package.
315
+ :my %*ATTR-CHECK; # Attribute names we must confirm exist.
316
+
317
<name>
318
[ 'is' 'repr(' <repr=.quote_EXPR> ')' ]?
319
320
+ {
321
+ # Construct meta-object for this package.
322
+ my $mo := %*HOW{$*PKGDECL};
323
+ my %args;
324
+ %args<name> := ~$<name>;
325
+ if $<repr> {
326
+ %args<repr> := ~$<repr>[0];
327
+ }
328
+ if pir::can($mo, 'parametric') && $mo.parametric($mo) {
329
+ %args<body_block> := -> $c { };
330
331
+ $*PKGMETA := $mo.new_type(|%args);
332
333
334
[ 'is' <parent=.name> ]?
335
[ 'does' <role=.name> ]*
336
[
0 commit comments