Skip to content

Commit

Permalink
Stub IterationBuffer in the bootstrap
Browse files Browse the repository at this point in the history
We need it in RakuAST::ScopePhaser, which is a role and has no easy
access to indirect lookups.
  • Loading branch information
niner committed Jan 10, 2023
1 parent 5189750 commit 4f1bbdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/Perl6/bootstrap.c/BOOTSTRAP.nqp
Expand Up @@ -73,6 +73,7 @@ my stub List metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Slip metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Array metaclass Perl6::Metamodel::ClassHOW { ... };
my stub array metaclass Perl6::Metamodel::ClassHOW is repr('VMArray') { ... };
my stub IterationBuffer metaclass Perl6::Metamodel::ClassHOW is repr('VMArray') { ... };
my stub Map metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Hash metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Capture metaclass Perl6::Metamodel::ClassHOW { ... };
Expand Down Expand Up @@ -3729,6 +3730,8 @@ BEGIN {

# class array does Iterable does Positional {
array.HOW.compose_repr(array);
# class IterationBuffer {
IterationBuffer.HOW.compose_repr(IterationBuffer);

# my class Map is Cool {
# has Mu $!storage;
Expand Down Expand Up @@ -3860,6 +3863,7 @@ BEGIN {
Perl6::Metamodel::ClassHOW.add_stash(Slip);
Perl6::Metamodel::ClassHOW.add_stash(Array);
Perl6::Metamodel::ClassHOW.add_stash(array);
Perl6::Metamodel::ClassHOW.add_stash(IterationBuffer);
Perl6::Metamodel::ClassHOW.add_stash(Map);
Perl6::Metamodel::ClassHOW.add_stash(Hash);
Perl6::Metamodel::ClassHOW.add_stash(Capture);
Expand Down Expand Up @@ -3972,6 +3976,7 @@ BEGIN {
EXPORT::DEFAULT.WHO<Slip> := Slip;
EXPORT::DEFAULT.WHO<Array> := Array;
EXPORT::DEFAULT.WHO<array> := array;
EXPORT::DEFAULT.WHO<IterationBuffer> := IterationBuffer;
EXPORT::DEFAULT.WHO<Map> := Map;
EXPORT::DEFAULT.WHO<Hash> := Hash;
EXPORT::DEFAULT.WHO<Capture> := Capture;
Expand Down
1 change: 1 addition & 0 deletions src/core.c/core_epilogue.pm6
Expand Up @@ -157,6 +157,7 @@ BEGIN .^compose for
int, int8, int16, int32, int64,
uint, uint8, uint16, uint32, uint64,
byte, num, num32, num64, str,
IterationBuffer
;

BEGIN Metamodel::ClassHOW.exclude_parent(Mu);
Expand Down
5 changes: 2 additions & 3 deletions src/core.c/core_prologue.pm6
Expand Up @@ -58,9 +58,8 @@ BEGIN {
}

# Set up Empty, which is a Slip created with an empty IterationBuffer (which
# we also stub here). This is needed in a bunch of simple constructs (like if
# with only one branch).
my class IterationBuffer is repr('VMArray') { ... }
# is stubbed in bootstrap). This is needed in a bunch of simple constructs
# (like if with only one branch).
my constant Empty = nqp::p6bindattrinvres(nqp::create(Slip),
List, '$!reified', nqp::create(IterationBuffer));

Expand Down

0 comments on commit 4f1bbdb

Please sign in to comment.