Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Start VMArrayHOW, expose it in the grammar.
- Loading branch information
Showing
8 changed files
with
47 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
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
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,35 @@ | ||
| class Perl6::Metamodel::VMArrayHOW | ||
| does Perl6::Metamodel::Naming | ||
| does Perl6::Metamodel::Versioning | ||
| does Perl6::Metamodel::Stashing | ||
| does Perl6::Metamodel::MethodContainer | ||
| does Perl6::Metamodel::PrivateMethodContainer | ||
| { | ||
| has $!element-type; | ||
| has $!composed; | ||
|
|
||
| method new(*%named) { | ||
| nqp::findmethod(NQPMu, 'BUILDALL')(nqp::create(self), |%named) | ||
| } | ||
|
|
||
| method new_type(:$name = '<anon>', :$ver, :$auth) { | ||
| my $metaclass := self.new(); | ||
| my $obj := pir::repr_type_object_for__PPS($metaclass, 'VMArray'); | ||
| self.add_stash($obj); | ||
| $metaclass.set_name($obj, $name); | ||
| $metaclass.set_ver($obj, $ver) if $ver; | ||
| $metaclass.set_auth($obj, $auth) if $auth; | ||
| $obj | ||
| } | ||
|
|
||
| method compose($obj) { | ||
| if !$!composed && $!element-type { | ||
| nqp::composetype($obj, hash(array => hash(type => $!element-type))); | ||
| $!composed := 1; | ||
| } | ||
| } | ||
|
|
||
| method parametrize($obj, $type) { | ||
| $!element-type := $type; | ||
| } | ||
| } |
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
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