Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stub in AttributeDeclarand and ContainerDeclarand, as a start to gett…
…ing something in place for trait application to container declarations. Based on discussion on #perl6, and not spec yet.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## $Id$ | ||
|
||
=head1 NAME | ||
|
||
src/classes/AttributeDeclarand.pir - Class specifying an attribute declaration | ||
|
||
=head1 DESCRIPTION | ||
|
||
This is the class that gets created and passed to a trait_mod to | ||
describe a declaration of an attribute container in a class. | ||
|
||
=cut | ||
|
||
.namespace [] | ||
|
||
.sub '' :anon :load :init | ||
.local pmc p6meta | ||
p6meta = get_hll_global ['Perl6Object'], '$!P6META' | ||
p6meta.'new_class'('AttributeDeclarand', 'parent'=>'ContainerDeclarand', 'attr'=>'$!how') | ||
.end | ||
|
||
.sub 'how' :method | ||
$P0 = getattribute self, '$!how' | ||
.return ($P0) | ||
.end | ||
|
||
# Local Variables: | ||
# mode: pir | ||
# fill-column: 100 | ||
# End: | ||
# vim: expandtab shiftwidth=4 ft=pir: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## $Id$ | ||
|
||
=head1 NAME | ||
|
||
src/classes/ContainerDeclarand.pir - Class specifying a declaration | ||
|
||
=head1 DESCRIPTION | ||
|
||
This is the class that gets created and passed to a trait_mod to | ||
describe a declaration of a container. | ||
|
||
=cut | ||
|
||
.namespace [] | ||
|
||
.sub '' :anon :load :init | ||
.local pmc p6meta | ||
p6meta = get_hll_global ['Perl6Object'], '$!P6META' | ||
p6meta.'new_class'('ContainerDeclarand', 'parent'=>'Any', 'attr'=>'$!container $!name') | ||
.end | ||
|
||
.sub 'container' :method | ||
$P0 = getattribute self, '$!container' | ||
.return ($P0) | ||
.end | ||
|
||
.sub 'name' :method | ||
$P0 = getattribute self, '$!name' | ||
.return ($P0) | ||
.end | ||
|
||
# Local Variables: | ||
# mode: pir | ||
# fill-column: 100 | ||
# End: | ||
# vim: expandtab shiftwidth=4 ft=pir: |