Skip to content

Commit

Permalink
s/Iterator/PredictiveIterator/ for native shaped arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 9, 2018
1 parent be07f30 commit 5cbbcc6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
27 changes: 15 additions & 12 deletions src/core/native_array.pm6
Expand Up @@ -1658,7 +1658,7 @@ my class array does Iterable {
} }


#- start of generated part of shapedintarray role ----------------------------- #- start of generated part of shapedintarray role -----------------------------
#- Generated on 2018-06-09T09:16:36+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6 #- Generated on 2018-09-09T16:19:43+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE #- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE


role shapedintarray does shapedarray { role shapedintarray does shapedarray {
Expand Down Expand Up @@ -2013,7 +2013,7 @@ my class array does Iterable {
) )
} }
method iterator(::?CLASS:D:) { method iterator(::?CLASS:D:) {
class :: does Iterator { class :: does PredictiveIterator {
has Mu $!list; has Mu $!list;
has int $!pos; has int $!pos;
method !SET-SELF(Mu \list) { method !SET-SELF(Mu \list) {
Expand Down Expand Up @@ -2045,8 +2045,9 @@ my class array does Iterable {
($!pos = $pos) ($!pos = $pos)
) )
} }
method count-only() { nqp::p6box_i(nqp::elems($!list)) } method count-only() {
method bool-only() { nqp::hllbool(nqp::elems($!list)) } nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) { method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list) $!pos = nqp::elems($!list)
} }
Expand Down Expand Up @@ -2209,7 +2210,7 @@ my class array does Iterable {
#- end of generated part of shapedintarray role ------------------------------- #- end of generated part of shapedintarray role -------------------------------


#- start of generated part of shapednumarray role ----------------------------- #- start of generated part of shapednumarray role -----------------------------
#- Generated on 2018-06-09T09:16:36+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6 #- Generated on 2018-09-09T16:19:43+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE #- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE


role shapednumarray does shapedarray { role shapednumarray does shapedarray {
Expand Down Expand Up @@ -2564,7 +2565,7 @@ my class array does Iterable {
) )
} }
method iterator(::?CLASS:D:) { method iterator(::?CLASS:D:) {
class :: does Iterator { class :: does PredictiveIterator {
has Mu $!list; has Mu $!list;
has int $!pos; has int $!pos;
method !SET-SELF(Mu \list) { method !SET-SELF(Mu \list) {
Expand Down Expand Up @@ -2596,8 +2597,9 @@ my class array does Iterable {
($!pos = $pos) ($!pos = $pos)
) )
} }
method count-only() { nqp::p6box_i(nqp::elems($!list)) } method count-only() {
method bool-only() { nqp::hllbool(nqp::elems($!list)) } nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) { method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list) $!pos = nqp::elems($!list)
} }
Expand Down Expand Up @@ -2760,7 +2762,7 @@ my class array does Iterable {
#- end of generated part of shapednumarray role ------------------------------- #- end of generated part of shapednumarray role -------------------------------


#- start of generated part of shapedstrarray role ----------------------------- #- start of generated part of shapedstrarray role -----------------------------
#- Generated on 2018-06-09T09:16:36+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6 #- Generated on 2018-09-09T16:19:43+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE #- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE


role shapedstrarray does shapedarray { role shapedstrarray does shapedarray {
Expand Down Expand Up @@ -3115,7 +3117,7 @@ my class array does Iterable {
) )
} }
method iterator(::?CLASS:D:) { method iterator(::?CLASS:D:) {
class :: does Iterator { class :: does PredictiveIterator {
has Mu $!list; has Mu $!list;
has int $!pos; has int $!pos;
method !SET-SELF(Mu \list) { method !SET-SELF(Mu \list) {
Expand Down Expand Up @@ -3147,8 +3149,9 @@ my class array does Iterable {
($!pos = $pos) ($!pos = $pos)
) )
} }
method count-only() { nqp::p6box_i(nqp::elems($!list)) } method count-only() {
method bool-only() { nqp::hllbool(nqp::elems($!list)) } nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) { method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list) $!pos = nqp::elems($!list)
} }
Expand Down
7 changes: 4 additions & 3 deletions tools/build/makeNATIVE_SHAPED_ARRAY.p6
Expand Up @@ -396,7 +396,7 @@ for $*IN.lines -> $line {
) )
} }
method iterator(::?CLASS:D:) { method iterator(::?CLASS:D:) {
class :: does Iterator { class :: does PredictiveIterator {
has Mu $!list; has Mu $!list;
has int $!pos; has int $!pos;
method !SET-SELF(Mu \list) { method !SET-SELF(Mu \list) {
Expand Down Expand Up @@ -428,8 +428,9 @@ for $*IN.lines -> $line {
($!pos = $pos) ($!pos = $pos)
) )
} }
method count-only() { nqp::p6box_i(nqp::elems($!list)) } method count-only() {
method bool-only() { nqp::hllbool(nqp::elems($!list)) } nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) { method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list) $!pos = nqp::elems($!list)
} }
Expand Down

0 comments on commit 5cbbcc6

Please sign in to comment.