[svn:parrot] r40191 - in trunk: compilers/json/JSON compilers/ncigen/src compilers/ncigen/src/builtins compilers/nqp/src compilers/nqp/src/Grammar compilers/pct/src/PAST compilers/pct/src/PCT compilers/pct/src/POST compilers/pge/PGE compilers/tge/TGE runtime/parrot/library runtime/parrot/library/Data runtime/parrot/library/Data/Dumper runtime/parrot/library/PGE runtime/parrot/library/SDL runtime/parrot/library/Stream runtime/parrot/library/Test runtime/parrot/library/YAML/Dumper t/compilers/pge t/compilers/pge/p5regex t/compilers/pge/perl6regex t/dynpmc t/library t/oo t/op t/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Tue Jul 21 12:56:23 UTC 2009
Author: bacek
Date: Tue Jul 21 12:56:20 2009
New Revision: 40191
URL: https://trac.parrot.org/parrot/changeset/40191
Log:
[cage] Replace deprecated usage of 'new "Iterator"' with 'iter $P0'
Modified:
trunk/compilers/json/JSON/pge2pir.tg
trunk/compilers/ncigen/src/NCIPIR.pir
trunk/compilers/ncigen/src/builtins/say.pir
trunk/compilers/nqp/src/Grammar/Actions.pir
trunk/compilers/nqp/src/builtins.pir
trunk/compilers/pct/src/PAST/Compiler.pir
trunk/compilers/pct/src/PAST/Node.pir
trunk/compilers/pct/src/PCT/HLLCompiler.pir
trunk/compilers/pct/src/PCT/Node.pir
trunk/compilers/pct/src/POST/Compiler.pir
trunk/compilers/pge/PGE/Exp.pir
trunk/compilers/pge/PGE/OPTable.pir
trunk/compilers/pge/PGE/Perl6Regex.pir
trunk/compilers/tge/TGE/Compiler.pir
trunk/compilers/tge/TGE/Grammar.pir
trunk/runtime/parrot/library/Crow.pir
trunk/runtime/parrot/library/Data/Dumper/Default.pir
trunk/runtime/parrot/library/Data/Replace.pir
trunk/runtime/parrot/library/JSON.pir
trunk/runtime/parrot/library/P6object.pir
trunk/runtime/parrot/library/PGE/Dumper.pir
trunk/runtime/parrot/library/PGE/Hs.pir
trunk/runtime/parrot/library/PGE/Perl6Grammar.pir
trunk/runtime/parrot/library/PGE/Util.pir
trunk/runtime/parrot/library/Protoobject.pir
trunk/runtime/parrot/library/SDL/StopWatch.pir
trunk/runtime/parrot/library/Stream/Combiner.pir
trunk/runtime/parrot/library/Test/Class.pir
trunk/runtime/parrot/library/Test/More.pir
trunk/runtime/parrot/library/YAML/Dumper/Default.pir
trunk/runtime/parrot/library/parrotlib.pir
trunk/t/compilers/pge/03-optable.t
trunk/t/compilers/pge/p5regex/p5rx.t
trunk/t/compilers/pge/perl6regex/01-regex.t
trunk/t/dynpmc/dynlexpad.t
trunk/t/library/mime_base64.t
trunk/t/library/protoobject.t
trunk/t/oo/metamodel.t
trunk/t/op/sprintf.t
trunk/t/pmc/hash.t
trunk/t/pmc/io_iterator.t
trunk/t/pmc/iterator.t
trunk/t/pmc/namespace.t
trunk/t/pmc/object-mro.t
trunk/t/pmc/orderedhash.t
trunk/t/pmc/resizablepmcarray.t
Modified: trunk/compilers/json/JSON/pge2pir.tg
==============================================================================
--- trunk/compilers/json/JSON/pge2pir.tg Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/json/JSON/pge2pir.tg Tue Jul 21 12:56:20 2009 (r40191)
@@ -3,7 +3,7 @@
transform result (ROOT) {
.local pmc pir
.local string result
-
+
$S0 = tree.'get'('pir', node, 'value')
pir = new 'CodeString'
@@ -14,7 +14,7 @@
pir.'emit'('.end')
.return(pir)
-}
+}
transform pir (value) {
@@ -25,7 +25,7 @@
type = 'string'
sub_node = node[type]
unless null sub_node goto got_type
-
+
type = 'number'
sub_node = node[type]
unless null sub_node goto got_type
@@ -84,7 +84,7 @@
.local string result, child_result, key_result
result = pir.'unique'('$P')
pir.'emit'(" %0 = new 'Hash'", result)
-
+
.local pmc items
items = node['members']
@@ -96,23 +96,23 @@
keys = items['string']
items = items['value']
- .local pmc iter, key_iter, child, key
- key_iter = new 'Iterator', keys
- iter = new 'Iterator', items
+ .local pmc it, key_iter, child, key
+ key_iter = iter keys
+ it = iter items
# the two iters should be in lockstep as a result of the PGE grammar
loop:
- unless iter goto end
- child = shift iter
+ unless it goto end
+ child = shift it
$P0 = tree.'get'('pir', child, 'value')
$S0 = $P0
- pir .= $S0
+ pir .= $S0
child_result = child['ret']
key = shift key_iter
$P0 = tree.'get'('pir', key, 'string')
$S0 = $P0
- pir .= $S0
+ pir .= $S0
key_result = key['ret']
pir.'emit'(' %0[%1] = %2', result, key_result, child_result)
@@ -122,7 +122,7 @@
end:
node['ret'] = result
- .return (pir)
+ .return (pir)
}
transform pir (array) {
@@ -131,7 +131,7 @@
.local string result, child_result
result = pir.'unique'('$P')
pir.'emit'(" %0 = new 'ResizablePMCArray'", result)
-
+
.local pmc items
@@ -140,14 +140,14 @@
items = items['value']
- .local pmc iter, child
- iter = new 'Iterator', items
+ .local pmc it, child
+ it = iter items
loop:
- unless iter goto end
- child = shift iter
+ unless it goto end
+ child = shift it
$P0 = tree.'get'('pir', child, 'value')
$S0 = $P0
- pir .= $S0
+ pir .= $S0
child_result = child['ret']
pir.'emit'(' push %0, %1', result, child_result)
@@ -155,20 +155,20 @@
end:
node['ret'] = result
- .return (pir)
+ .return (pir)
}
transform pir (string) {
- .local pmc pir, result, children, iter, child
+ .local pmc pir, result, children, it, child
.local string tmp
tmp = ''
pir = new 'CodeString'
children = node['char']
if null children goto loop_end
- iter = new 'Iterator', children
+ it = iter children
loop:
push_eh loop_end
- child = shift iter
+ child = shift it
pop_eh
unless child goto loop_end
$S0 = child
@@ -180,7 +180,7 @@
$S1 = substr $S0, 2, 4
$P1 = $S1
$I0 = $P1.'to_int'(16)
- $S0 = chr $I0
+ $S0 = chr $I0
goto char
escape:
$P0 = get_root_global [ 'JSON' ], '$escapes'
Modified: trunk/compilers/ncigen/src/NCIPIR.pir
==============================================================================
--- trunk/compilers/ncigen/src/NCIPIR.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/ncigen/src/NCIPIR.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -134,14 +134,14 @@
.sub 'pir_children' :method
.param pmc node
- .local pmc code, iter
+ .local pmc code, it
code = new 'CodeString'
- iter = new 'Iterator', node
+ it = iter node
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string key
.local pmc cast
- key = shift iter
+ key = shift it
cast = node[key]
$P0 = self.'pir'(cast)
code .= $P0
Modified: trunk/compilers/ncigen/src/builtins/say.pir
==============================================================================
--- trunk/compilers/ncigen/src/builtins/say.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/ncigen/src/builtins/say.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -11,11 +11,11 @@
.sub 'say'
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
@@ -26,10 +26,12 @@
.sub 'printf'
.param pmc format
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
+ $P0 = shift it
+ print $P0
goto iter_loop
iter_end:
.end
Modified: trunk/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- trunk/compilers/nqp/src/Grammar/Actions.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/nqp/src/Grammar/Actions.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -103,11 +103,11 @@
past = $P0.'new'('node'=>match)
$P1 = match['statement']
if null $P1 goto iter_end
- .local pmc iter
- iter = new 'Iterator', $P1
+ .local pmc it
+ it = iter $P1
iter_loop:
- unless iter goto iter_end
- $P2 = shift iter
+ unless it goto iter_end
+ $P2 = shift it
$P2 = $P2.'ast'()
past.'push'($P2)
goto iter_loop
@@ -411,11 +411,11 @@
$P0 = $P0[0]
if null $P0 goto param_end
unless $P0 goto param_end
- .local pmc iter
- iter = new 'Iterator', $P0
+ .local pmc it
+ it = iter $P0
param_loop:
- unless iter goto param_end
- $P1 = shift iter
+ unless it goto param_end
+ $P1 = shift it
.local pmc parameter
$P2 = $P1['parameter']
parameter = $P2.'ast'()
@@ -517,11 +517,11 @@
past = $P0.'ast'()
$P1 = match['postfix']
if null $P1 goto end
- .local pmc iter, term
- iter = new 'Iterator', $P1
+ .local pmc it, term
+ it = iter $P1
iter_loop:
- unless iter goto end
- $P2 = shift iter
+ unless it goto end
+ $P2 = shift it
term = past
past = $P2.'ast'()
past.'unshift'(term)
@@ -1038,11 +1038,11 @@
past = $P0.'new'('node'=>match, 'name'=>name, 'opattr'=>opattr)
$P1 = match.'list'()
if null $P1 goto iter_end
- .local pmc iter
- iter = new 'Iterator', $P1
+ .local pmc it
+ it = iter $P1
iter_loop:
- unless iter goto iter_end
- $P2 = shift iter
+ unless it goto iter_end
+ $P2 = shift it
$I0 = $P2.'from'()
$I1 = $P2.'to'()
if $I0 == $I1 goto iter_loop
Modified: trunk/compilers/nqp/src/builtins.pir
==============================================================================
--- trunk/compilers/nqp/src/builtins.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/nqp/src/builtins.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -13,12 +13,12 @@
.sub 'print'
.param pmc list :slurpy
- .local pmc iter
+ .local pmc it
- iter = new 'Iterator', list
+ it = iter list
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
Modified: trunk/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/PAST/Compiler.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pct/src/PAST/Compiler.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -664,7 +664,7 @@
.local string rtype
rtype = options['rtype']
- .local pmc iter, node, ops, pops, tail, skip
+ .local pmc it, node, ops, pops, tail, skip
$P0 = get_hll_global ['POST'], 'Ops'
ops = $P0.'new'('node'=>node)
$P0 = get_hll_global ['POST'], 'Ops'
@@ -675,10 +675,10 @@
$S0 = self.'unique'('skip_handler_')
skip = $P0.'new'('result'=>$S0)
- iter = new 'Iterator', ehs
+ it = iter ehs
handler_loop:
- unless iter, handler_loop_done
- node = shift iter
+ unless it, handler_loop_done
+ node = shift it
.local pmc ehpir, types, label
.local string ehreg, type
@@ -826,14 +826,14 @@
## merge the Block's symtable with outersym
symtable = clone symtable
symtable_merge:
- .local pmc iter
- iter = new 'Iterator', outersym
+ .local pmc it
+ it = iter outersym
symtable_merge_loop:
- unless iter goto have_symtable
- $S0 = shift iter
+ unless it goto have_symtable
+ $S0 = shift it
$I0 = exists symtable[$S0]
if $I0 goto symtable_merge_loop
- $P0 = iter[$S0]
+ $P0 = it[$S0]
symtable[$S0] = $P0
goto symtable_merge_loop
have_symtable:
@@ -1499,14 +1499,14 @@
returns = box 'ResizablePMCArray'
have_returns:
- .local pmc listpost, iter
+ .local pmc listpost, it
listpost = self.'as_vivipost'(returns, 'rtype'=>'P')
ops.'result'(listpost)
ops.'push'(listpost)
- iter = new 'Iterator', posargs
+ it = iter posargs
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
ops.'push_pirop'('push', listpost, $S0)
goto iter_loop
iter_end:
Modified: trunk/compilers/pct/src/PAST/Node.pir
==============================================================================
--- trunk/compilers/pct/src/PAST/Node.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pct/src/PAST/Node.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -430,7 +430,7 @@
.param pmc hash
$P0 = split ' ', "pasttype pirop inline lvalue"
- $P1 = new 'Iterator', $P0
+ $P1 = iter $P0
iter_loop:
unless $P1 goto iter_end
$S0 = shift $P1
Modified: trunk/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- trunk/compilers/pct/src/PCT/HLLCompiler.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pct/src/PCT/HLLCompiler.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -41,11 +41,11 @@
Options:
USAGE
- .local pmc iter
- iter = new 'Iterator', $P0
+ .local pmc it
+ it = iter $P0
options_loop:
- unless iter goto options_end
- $P3 = shift iter
+ unless it goto options_end
+ $P3 = shift it
$P1 .= " "
$P1 .= $P3
$P1 .= "\n"
@@ -193,15 +193,15 @@
.sub 'removestage' :method
.param string stagename
- .local pmc stages, iter, newstages
+ .local pmc stages, it, newstages
stages = getattribute self, '@stages'
newstages = new 'ResizableStringArray'
- iter = new 'Iterator', stages
+ it = iter stages
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local pmc current
- current = shift iter
+ current = shift it
if current == stagename goto iter_loop
push newstages, current
goto iter_loop
@@ -245,14 +245,14 @@
target = adverbs['after']
positional_insert:
- .local pmc iter, newstages
+ .local pmc it, newstages
newstages = new 'ResizableStringArray'
- iter = new 'Iterator', stages
+ it = iter stages
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local pmc current
- current = shift iter
+ current = shift it
unless current == target goto no_insert_before
unless position == 'before' goto no_insert_before
push newstages, stagename
@@ -293,14 +293,14 @@
target = adverbs['target']
target = downcase target
- .local pmc stages, result, iter
+ .local pmc stages, result, it
result = source
stages = getattribute self, '@stages'
- iter = new 'Iterator', stages
+ it = iter stages
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string stagename
- stagename = shift iter
+ stagename = shift it
result = self.stagename(result, adverbs :flat :named)
if target == stagename goto have_result
goto iter_loop
@@ -690,13 +690,13 @@
have_files_array:
.local string code
code = ''
- .local pmc iter
- iter = new 'Iterator', files
+ .local pmc it
+ it = iter files
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string iname
.local pmc ifh
- iname = shift iter
+ iname = shift it
ifh = new 'FileHandle'
unless encoding == 'utf8' goto iter_loop_1
ifh.'encoding'(encoding)
@@ -738,11 +738,11 @@
getopts = new 'Getopt::Obj'
getopts.'notOptStop'(1)
$P0 = getattribute self, '@cmdoptions'
- .local pmc iter
- iter = new 'Iterator', $P0
+ .local pmc it
+ it = iter $P0
getopts_loop:
- unless iter goto getopts_end
- $S0 = shift iter
+ unless it goto getopts_end
+ $S0 = shift it
push getopts, $S0
goto getopts_loop
getopts_end:
@@ -783,11 +783,11 @@
opts = self.'process_args'(args)
## merge command-line args with defaults passed in from caller
- .local pmc iter
- iter = new 'Iterator', opts
+ .local pmc it
+ it = iter opts
mergeopts_loop:
- unless iter goto mergeopts_end
- $S0 = shift iter
+ unless it goto mergeopts_end
+ $S0 = shift it
$P0 = opts[$S0]
adverbs[$S0] = $P0
goto mergeopts_loop
Modified: trunk/compilers/pct/src/PCT/Node.pir
==============================================================================
--- trunk/compilers/pct/src/PCT/Node.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pct/src/PCT/Node.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -57,20 +57,20 @@
.param pmc children :slurpy
.param pmc adverbs :slurpy :named
- .local pmc iter
- iter = new 'Iterator', children
+ .local pmc it
+ it = iter children
children_loop:
- unless iter goto children_end
- $P0 = shift iter
+ unless it goto children_end
+ $P0 = shift it
push self, $P0
goto children_loop
children_end:
- iter = new 'Iterator', adverbs
+ it = iter adverbs
adverbs_loop:
- unless iter goto adverbs_end
- $S0 = shift iter
- $P0 = iter[$S0]
+ unless it goto adverbs_end
+ $S0 = shift it
+ $P0 = it[$S0]
$P1 = find_method self, $S0
self.$P1($P0)
goto adverbs_loop
@@ -180,11 +180,10 @@
=cut
.sub 'iterator' :method
- .local pmc iter
+ .local pmc it
$P0 = self.'list'()
- iter = new 'Iterator', $P0
- iter = 0
- .return (iter)
+ it = iter $P0
+ .return (it)
.end
Modified: trunk/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/POST/Compiler.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pct/src/POST/Compiler.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -293,11 +293,11 @@
.local pmc paramlist
paramlist = node['paramlist']
if null paramlist goto paramlist_done
- .local pmc iter
- iter = new 'Iterator', paramlist
+ .local pmc it
+ it = iter paramlist
param_loop:
- unless iter goto paramlist_done
- $P0 = shift iter
+ unless it goto paramlist_done
+ $P0 = shift it
if null $P0 goto param_loop
subpir .= $P0
goto param_loop
Modified: trunk/compilers/pge/PGE/Exp.pir
==============================================================================
--- trunk/compilers/pge/PGE/Exp.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pge/PGE/Exp.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -443,15 +443,15 @@
.param string label
.param string next
- .local pmc iter, exp
+ .local pmc it, exp
code.'emit'(' %0: # concat', label)
$P0 = self.'list'()
- iter = new 'Iterator', $P0
- exp = shift iter
+ it = iter $P0
+ exp = shift it
$S0 = code.'unique'('R')
iter_loop:
- unless iter goto iter_end
- $P1 = shift iter
+ unless it goto iter_end
+ $P1 = shift it
$S1 = code.'unique'('R')
exp.'pir'(code, $S0, $S1)
exp = $P1
Modified: trunk/compilers/pge/PGE/OPTable.pir
==============================================================================
--- trunk/compilers/pge/PGE/OPTable.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pge/PGE/OPTable.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -110,7 +110,7 @@
if $I0 goto end
tokentable[name] = token
- $P0 = new 'Iterator', args
+ $P0 = iter args
args_loop:
unless $P0 goto args_end
$S1 = shift $P0
@@ -239,7 +239,7 @@
.local pmc ws
.local string key
.local pmc token, top, oper
- .local pmc iter
+ .local pmc it
.local int tokencat, topcat
.local int circumnest
.local pmc cstack
@@ -367,10 +367,10 @@
if oper goto oper_found
goto key_next
key_array:
- iter = new 'Iterator', token
+ it = iter token
key_array_1:
- unless iter goto key_next
- token = shift iter
+ unless it goto key_next
+ token = shift it
local_branch cstack, token_match
if_null oper, key_array_1
if oper goto oper_found
Modified: trunk/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- trunk/compilers/pge/PGE/Perl6Regex.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/pge/PGE/Perl6Regex.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -1667,14 +1667,14 @@
.tailcall exp1.'perl6exp'(pad)
with_lhs:
- .local pmc lexscope, savescope, iter
+ .local pmc lexscope, savescope, it
lexscope = pad['lexscope']
savescope = new 'Hash'
- iter = new 'Iterator', lexscope
+ it = iter lexscope
iter_loop:
- unless iter goto iter_end
- $P1 = shift iter
- $P2 = iter[$P1]
+ unless it goto iter_end
+ $P1 = shift it
+ $P2 = it[$P1]
savescope[$P1] = $P2
goto iter_loop
iter_end:
Modified: trunk/compilers/tge/TGE/Compiler.pir
==============================================================================
--- trunk/compilers/tge/TGE/Compiler.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/tge/TGE/Compiler.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -89,12 +89,11 @@
# Iterate over the list of statements, and generate a processed tree for
# each statement. Return an array of all the processed statements.
- .local pmc iter
- iter = new 'Iterator', node # loop over the array
- iter = 0 # start at the beginning
+ .local pmc it
+ it = iter node # loop over the array
loop_start:
- unless iter goto loop_end
- $P1 = shift iter
+ unless it goto loop_end
+ $P1 = shift it
$P2 = tree.'get'('result', $P1, 'statement')
push statements, $P2
goto loop_start
@@ -111,14 +110,13 @@
.param pmc node
.local pmc result
- .local pmc iter
+ .local pmc it
$P0 = node.'hash'()
- iter = new 'Iterator', $P0 # setup iterator for node
- iter = 0
+ it = iter $P0 # setup iterator for node
iter_loop:
- unless iter, iter_end # while (entries) ...
- shift $S1, iter # get the key of the iterator
- $P2 = iter[$S1]
+ unless it, iter_end # while (entries) ...
+ shift $S1, it # get the key of the iterator
+ $P2 = it[$S1]
result = tree.'get'('result', $P2, $S1)
@@ -134,15 +132,14 @@
.local pmc rule
rule = new 'Hash'
- .local pmc iter
+ .local pmc it
$P0 = node.'hash'()
- iter = new 'Iterator', $P0 # setup iterator for node
- iter = 0
+ it = iter $P0 # setup iterator for node
iter_loop:
- unless iter, iter_end # while (entries) ...
+ unless it, iter_end # while (entries) ...
$P3 = new 'Undef'
- shift $S1, iter # get the key of the iterator
- $P2 = iter[$S1]
+ shift $S1, it # get the key of the iterator
+ $P2 = it[$S1]
$P3 = tree.'get'('value', $P2, $S1)
@@ -169,15 +166,14 @@
.local pmc decl
decl = new 'Hash'
- .local pmc iter
+ .local pmc it
$P0 = node.'hash'()
- iter = new 'Iterator', $P0 # setup iterator for node
- iter = 0
+ it = iter $P0 # setup iterator for node
iter_loop:
- unless iter, iter_end # while (entries) ...
+ unless it, iter_end # while (entries) ...
$P3 = new 'Undef'
- shift $S1, iter # get the key of the iterator
- $P2 = iter[$S1]
+ shift $S1, it # get the key of the iterator
+ $P2 = it[$S1]
$P3 = tree.'get'('value', $P2, $S1)
@@ -296,12 +292,11 @@
# Construct grammar rules from the data structure of rule info
.local pmc statement
- .local pmc iter
- iter = new 'Iterator', rule_data # loop over the rule info
- iter = 0 # start at the beginning
+ .local pmc it
+ it = iter rule_data # loop over the rule info
loop_start:
- unless iter goto loop_end
- statement = shift iter
+ unless it goto loop_end
+ statement = shift it
$S0 = statement['build']
unless $S0 == 'rule' goto grammar_build
$S1 = self.'rule_string'(statement)
Modified: trunk/compilers/tge/TGE/Grammar.pir
==============================================================================
--- trunk/compilers/tge/TGE/Grammar.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/compilers/tge/TGE/Grammar.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -140,7 +140,7 @@
.sub 'symbol_iter' :method
$P1 = getattribute self, 'symbols'
- $P2 = new 'Iterator', $P1
+ $P2 = iter $P1
.return($P2)
.end
Modified: trunk/runtime/parrot/library/Crow.pir
==============================================================================
--- trunk/runtime/parrot/library/Crow.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Crow.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -110,16 +110,16 @@
.param string template
.param pmc data
- .local pmc iter
- iter = new 'Iterator', data
+ .local pmc it
+ it = iter data
.local string symbol, value
it_loop:
- unless iter goto it_done
- $P0 = shift iter
+ unless it goto it_done
+ $P0 = shift it
symbol = 'get_symbol'($P0)
- value = iter[$P0]
+ value = it[$P0]
repl_loop:
$I0 = index template, symbol
if -1 == $I0 goto repl_done
Modified: trunk/runtime/parrot/library/Data/Dumper/Default.pir
==============================================================================
--- trunk/runtime/parrot/library/Data/Dumper/Default.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Data/Dumper/Default.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -110,7 +110,7 @@
.param pmc hash
.local string indent
.local string subindent
- .local pmc iter
+ .local pmc it
.local string key
.local pmc val
.local pmc keys
@@ -124,13 +124,12 @@
print " {"
new keys, "ResizablePMCArray"
- new iter, "Iterator", hash
- set iter, 0
+ it = iter hash
iter_loop:
- unless iter, iter_end
+ unless it, iter_end
- shift key, iter
+ shift key, it
push keys, key
branch iter_loop
@@ -422,11 +421,11 @@
.local string subindent, indent
(subindent, indent) = dumper.'newIndent'()
- .local pmc hash, iter
+ .local pmc hash, it
hash = self.'hash'()
- iter = new 'Iterator', hash
+ it = iter hash
dump_hash_loop:
- unless iter goto dump_hash_end
+ unless it goto dump_hash_end
if hasstuff goto dump_hash_1
print " {"
hasstuff = 1
@@ -435,7 +434,7 @@
print subindent
.local string key
.local pmc val
- key = shift iter
+ key = shift it
val = hash[key]
print "<"
print key
Modified: trunk/runtime/parrot/library/Data/Replace.pir
==============================================================================
--- trunk/runtime/parrot/library/Data/Replace.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Data/Replace.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -150,18 +150,16 @@
.param pmc oldVal
.param pmc newVal
.param pmc cache
- .local pmc iter
+ .local pmc it
.local string key
.local pmc val
- new iter, 'Iterator', where
- set iter, 0
+ it = iter where
LOOP:
- unless iter, END
-
- shift key, iter
+ unless it goto END
+ key = shift it
val = where[key]
ne_addr val, oldVal, SKIP
@@ -184,18 +182,16 @@
.param pmc oldVal
.param pmc newVal
.param pmc cache
- .local pmc iter
+ .local pmc it
.local string key
.local pmc val
- new iter, 'Iterator', where
- set iter, 0
+ it = iter where
LOOP:
- unless iter, END
-
- shift key, iter
+ unless it goto END
+ key = shift it
val = where[key]
ne_addr val, oldVal, SKIP
Modified: trunk/runtime/parrot/library/JSON.pir
==============================================================================
--- trunk/runtime/parrot/library/JSON.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/JSON.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -262,14 +262,13 @@
.local pmc keys
keys = new 'ResizablePMCArray'
- .local pmc iter
- iter = new 'Iterator', thing
- iter = 0
+ .local pmc it
+ it = iter thing
.local string key
iter_loop:
- unless iter, done_iter
- shift key, iter
+ unless it, done_iter
+ shift key, it
push keys, key
goto iter_loop
Modified: trunk/runtime/parrot/library/P6object.pir
==============================================================================
--- trunk/runtime/parrot/library/P6object.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/P6object.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -227,12 +227,12 @@
.local pmc parrotclassns, mroiter, methods, methoditer
parrotclassns = parrotclass.'get_namespace'()
$P0 = parentclass.'inspect'('all_parents')
- mroiter = new 'Iterator', $P0
+ mroiter = iter $P0
mro_loop:
unless mroiter goto mro_end
$P0 = shift mroiter
methods = $P0.'methods'()
- methoditer = new 'Iterator', methods
+ methoditer = iter methods
method_loop:
unless methoditer goto mro_loop
$S0 = shift methoditer
@@ -400,11 +400,11 @@
$S0 = parentclass
parentclass = split ' ', $S0
parent_array:
- .local pmc iter, item
- iter = new 'Iterator', parentclass
+ .local pmc it, item
+ it = iter parentclass
parent_loop:
- unless iter goto parent_done
- item = shift iter
+ unless it goto parent_done
+ item = shift it
$S0 = item
$P0 = split ';', $S0
$I0 = elements $P0
@@ -469,10 +469,10 @@
methodname = shift protooverrides
unless methodname goto override_loop
$P0 = parrotclass.'inspect'('all_parents')
- iter = new 'Iterator', $P0
+ it = iter $P0
method_loop:
- unless iter goto method_end
- $P0 = shift iter
+ unless it goto method_end
+ $P0 = shift it
$P0 = $P0.'methods'()
$P0 = $P0[methodname]
if null $P0 goto method_loop
@@ -576,7 +576,7 @@
goto have_parrotclass
have_parrotclass:
- .local pmc attrlist, iter
+ .local pmc attrlist, it
attrlist = options['attr']
if null attrlist goto attr_done
$I0 = does attrlist, 'array'
@@ -584,10 +584,10 @@
$S0 = attrlist
attrlist = split ' ', $S0
have_attrlist:
- iter = new 'Iterator', attrlist
+ it = iter attrlist
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
unless $S0 goto iter_loop
addattribute parrotclass, $S0
goto iter_loop
Modified: trunk/runtime/parrot/library/PGE/Dumper.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Dumper.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/PGE/Dumper.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -26,7 +26,7 @@
.param pmc dumper
.param string label
.local string indent, subindent
- .local pmc iter, val
+ .local pmc it, val
.local string key
.local pmc hash, array
.local int hascapts
@@ -41,16 +41,16 @@
hascapts = 0
hash = self.'hash'()
if_null hash, dump_array
- iter = new 'Iterator', hash
+ it = iter hash
dump_hash_1:
- unless iter goto dump_array
+ unless it goto dump_array
if hascapts goto dump_hash_2
print " {"
hascapts = 1
dump_hash_2:
print "\n"
print subindent
- key = shift iter
+ key = shift it
val = hash[key]
print "<"
print key
@@ -102,7 +102,7 @@
.local pmc capt
.local int spi, spc
- .local pmc iter
+ .local pmc it
.local string prefix1, prefix2
if has_b2 goto start
@@ -147,10 +147,10 @@
subrules:
capt = self.'hash'()
if_null capt, end
- iter = new 'Iterator', capt
+ it = iter capt
subrules_1:
- unless iter goto end
- $S0 = shift iter
+ unless it goto end
+ $S0 = shift it
prefix1 = concat prefix, '<'
concat prefix1, $S0
concat prefix1, ">"
@@ -462,7 +462,7 @@
.param pmc dumper
.param string label
.local string indent, subindent
- .local pmc iter, val
+ .local pmc it, val
.local string key
.local pmc hash, array
@@ -470,12 +470,12 @@
print " {"
hash = self
if_null hash, dump_rest
- iter = new 'Iterator', hash
+ it = iter hash
dump_hash:
- unless iter goto dump_rest
+ unless it goto dump_rest
print "\n"
print subindent
- key = shift iter
+ key = shift it
val = hash[key]
print "<"
print key
Modified: trunk/runtime/parrot/library/PGE/Hs.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Hs.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/PGE/Hs.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -164,7 +164,7 @@
.local int ari, arc
.local int tmpi, cond
.local string tmps, key
- .local pmc capt, iter, subelm, elm
+ .local pmc capt, it, subelm, elm
out = ""
@@ -204,11 +204,10 @@
out .= "] ["
capt = self.'hash'()
if_null capt, end
- iter = new 'Iterator', capt
- iter = 0
- unless iter goto end
+ it = iter capt
+ unless it goto end
subrules_body:
- key = shift iter
+ key = shift it
cond = defined capt[key]
unless cond goto subrules_fail
elm = capt[key]
@@ -218,13 +217,13 @@
out .= '", '
bsr dumper
out .= ")"
- unless iter goto end
+ unless it goto end
out .= ", "
goto subrules_body
subrules_fail:
out .= PGE_FAIL
- key = shift iter
- unless iter goto end
+ key = shift it
+ unless it goto end
goto subrules_body
dumper:
Modified: trunk/runtime/parrot/library/PGE/Perl6Grammar.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Perl6Grammar.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/PGE/Perl6Grammar.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -169,15 +169,15 @@
goto stmt_loop
stmt_end:
- .local pmc initpir, rulepir, iter, ns
+ .local pmc initpir, rulepir, it, ns
.local string namespace
initpir = new 'CodeString'
rulepir = new 'CodeString'
- iter = new 'Iterator', nstable
+ it = iter nstable
iter_loop:
- unless iter goto iter_end
- namespace = shift iter
- ns = iter[namespace]
+ unless it goto iter_end
+ namespace = shift it
+ ns = it[namespace]
$P0 = ns['rule']
rulepir .= $P0
if namespace == 'PGE::Grammar' goto ns_optable
@@ -353,15 +353,15 @@
optable = $P0['optable']
## build the list of traits
- .local pmc iter
+ .local pmc it
.local string traitlist
$P0 = stmt[0]
- iter = new 'Iterator', $P0
+ it = iter $P0
traitlist = ''
trait_loop:
- unless iter goto trait_end
+ unless it goto trait_end
.local pmc t
- t = shift iter
+ t = shift it
.local string trait, arg
trait = t['trait']
$P0 = t['arg']
Modified: trunk/runtime/parrot/library/PGE/Util.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Util.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/PGE/Util.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -39,13 +39,13 @@
.param pmc mob # match object
.param pmc list :slurpy # message arguments
- .local pmc iter
+ .local pmc it
.local string message
message = ''
- iter = new 'Iterator', list
+ it = iter list
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
message .= $S0
goto iter_loop
iter_end:
@@ -100,13 +100,13 @@
.param pmc mob # match object
.param pmc list :slurpy # message arguments
- .local pmc iter
+ .local pmc it
.local string message
message = ''
- iter = new 'Iterator', list
+ it = iter list
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
message .= $S0
goto iter_loop
iter_end:
Modified: trunk/runtime/parrot/library/Protoobject.pir
==============================================================================
--- trunk/runtime/parrot/library/Protoobject.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Protoobject.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -120,11 +120,11 @@
subc = subclass baseclass, name
unless attrs goto done_attrs
- .local pmc iter
- iter = new 'Iterator', attrs
+ .local pmc it
+ it = iter attrs
iter_loop:
- unless iter goto done_attrs
- $S0 = shift iter
+ unless it goto done_attrs
+ $S0 = shift it
addattribute subc, $S0
goto iter_loop
done_attrs:
Modified: trunk/runtime/parrot/library/SDL/StopWatch.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/StopWatch.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/SDL/StopWatch.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -282,8 +282,7 @@
$I0 = array
if $I0 == 0 goto DISABLE
- array = new 'Iterator', array
- array = .ITERATE_FROM_START
+ array = iter array
LOOP:
unless array goto END
$P0 = shift array
Modified: trunk/runtime/parrot/library/Stream/Combiner.pir
==============================================================================
--- trunk/runtime/parrot/library/Stream/Combiner.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Stream/Combiner.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -118,8 +118,7 @@
if i == 0 goto NOT_CONNECTED
# create an iterator for the sources
- new sources, 'Iterator', sources
- set sources, .ITERATE_FROM_START
+ sources = iter sources
LOOP:
# stream is connected if no sources are left
@@ -162,8 +161,7 @@
if i == 0 goto END_OF_STREAM
# create an iterator for the sources
- new sources, 'Iterator', sources
- set sources, .ITERATE_FROM_START
+ sources = iter sources
# create the string array
new args, 'ResizableStringArray'
Modified: trunk/runtime/parrot/library/Test/Class.pir
==============================================================================
--- trunk/runtime/parrot/library/Test/Class.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Test/Class.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -258,13 +258,13 @@
.local pmc attribute
attribute = getattribute self, name
- .local pmc iter
- iter = new 'Iterator', attribute
+ .local pmc it
+ it = iter attribute
.local string meth_name
iter_loop:
- unless iter goto loop_end
- meth_name = shift iter
+ unless it goto loop_end
+ meth_name = shift it
self.meth_name()
goto iter_loop
loop_end:
@@ -276,14 +276,14 @@
.local pmc tests
tests = getattribute self, 'tests'
- .local pmc iter
- iter = new 'Iterator', tests
+ .local pmc it
+ it = iter tests
.local string meth_name
iter_loop:
- unless iter goto loop_end
+ unless it goto loop_end
self.'loop_over_methods'( 'setup' )
- meth_name = shift iter
+ meth_name = shift it
self.meth_name()
self.'loop_over_methods'( 'teardown' )
goto iter_loop
Modified: trunk/runtime/parrot/library/Test/More.pir
==============================================================================
--- trunk/runtime/parrot/library/Test/More.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/Test/More.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -577,8 +577,8 @@
.local pmc r_iter
.local int count
- l_iter = new 'Iterator', l_array
- r_iter = new 'Iterator', r_array
+ l_iter = iter l_array
+ r_iter = iter r_array
l_iter = 0
r_iter = 0
count = 0
@@ -641,7 +641,7 @@
.local pmc l_iter
.local int count
- l_iter = new 'Iterator', l_hash
+ l_iter = iter l_hash
l_iter = 0
count = 0
Modified: trunk/runtime/parrot/library/YAML/Dumper/Default.pir
==============================================================================
--- trunk/runtime/parrot/library/YAML/Dumper/Default.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/YAML/Dumper/Default.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -120,7 +120,7 @@
.sub genericHash :method
.param string name
.param pmc hash
- .local pmc iter
+ .local pmc it
.local string key
.local pmc val
.local pmc keys
@@ -133,13 +133,12 @@
print " {"
new keys, "ResizablePMCArray"
- new iter, "Iterator", hash
- set iter, 0
+ it = iter hash
iter_loop:
- unless iter, iter_end
+ unless it, iter_end
- shift key, iter
+ shift key, it
push keys, key
branch iter_loop
Modified: trunk/runtime/parrot/library/parrotlib.pir
==============================================================================
--- trunk/runtime/parrot/library/parrotlib.pir Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/runtime/parrot/library/parrotlib.pir Tue Jul 21 12:56:20 2009 (r40191)
@@ -165,16 +165,15 @@
.param string name
.param pmc array
.local string ret
- .local pmc iter
+ .local pmc it
- iter = new 'Iterator', array
- iter = 0 #ITERATE_FROM_START
+ it = iter array
NEXT:
null ret
- unless iter goto END
+ unless it goto END
- $P0 = shift iter
+ $P0 = shift it
ret = $P0( name )
if_null ret, NEXT
END:
Modified: trunk/t/compilers/pge/03-optable.t
==============================================================================
--- trunk/t/compilers/pge/03-optable.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/compilers/pge/03-optable.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -159,17 +159,16 @@
if type == 'term:' goto print_term
if type == 'term:->' goto print_term_arrow
print '('
- .local pmc iter
+ .local pmc it
$P0 = match.'list'()
if null $P0 goto iter_end
unless $P0 goto iter_end
- iter = new 'Iterator', $P0
- iter = 0
- unless iter goto iter_end
+ it = iter $P0
+ unless it goto iter_end
iter_loop:
- $P0 = shift iter
+ $P0 = shift it
tree($P0)
- unless iter goto iter_end
+ unless it goto iter_end
print ', '
goto iter_loop
iter_end:
Modified: trunk/t/compilers/pge/p5regex/p5rx.t
==============================================================================
--- trunk/t/compilers/pge/p5regex/p5rx.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/compilers/pge/p5regex/p5rx.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -81,7 +81,7 @@
push test_files, 're_tests'
.local pmc file_iterator # iterate over list of files..
- file_iterator = new 'Iterator', test_files
+ file_iterator = iter test_files
.local int test_number # the number of the test we're running
test_number = 0
Modified: trunk/t/compilers/pge/perl6regex/01-regex.t
==============================================================================
--- trunk/t/compilers/pge/perl6regex/01-regex.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/compilers/pge/perl6regex/01-regex.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -93,7 +93,7 @@
has_icu = config['has_icu']
.local pmc file_iterator # iterate over list of files..
- file_iterator = new 'Iterator', test_files
+ file_iterator = iter test_files
.local int test_number # the number of the test we're running
test_number = 0
Modified: trunk/t/dynpmc/dynlexpad.t
==============================================================================
--- trunk/t/dynpmc/dynlexpad.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/dynpmc/dynlexpad.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -228,7 +228,7 @@
dlp = interp['lexpad']
say "Getting iterator"
- it = new 'Iterator', dlp
+ it = iter dlp
say "Have iterator"
iter_loop:
unless it goto iter_done
Modified: trunk/t/library/mime_base64.t
==============================================================================
--- trunk/t/library/mime_base64.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/library/mime_base64.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -332,7 +332,7 @@
.local pmc test_iterator, test_case
.local string plain, base64, comment, comment_cnt
- test_iterator = new 'Iterator', encode_decode_tests
+ test_iterator = iter encode_decode_tests
enc_dec_loop:
unless test_iterator goto enc_dec_loop_end
test_case = shift test_iterator
@@ -350,7 +350,7 @@
goto enc_dec_loop
enc_dec_loop_end:
- test_iterator = new 'Iterator', decode_tests
+ test_iterator = iter decode_tests
dec_loop:
unless test_iterator goto dec_loop_end
test_case = shift test_iterator
Modified: trunk/t/library/protoobject.t
==============================================================================
--- trunk/t/library/protoobject.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/library/protoobject.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -143,12 +143,12 @@
attrs = split ' ', '$a $b $c $d'
protomaker.'new_subclass'(hashclass, 'Foo::Bar', attrs :flat)
- .local pmc object, iter
+ .local pmc object, it
object = new 'Foo::Bar'
- iter = new 'Iterator', attrs
+ it = iter attrs
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
$S0 = $P0
setattribute object, $S0, $P0
$P1 = getattribute object, $S0
Modified: trunk/t/oo/metamodel.t
==============================================================================
--- trunk/t/oo/metamodel.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/oo/metamodel.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -109,13 +109,12 @@
.sub init_pmc :vtable :method
.param pmc init_args
# Iterate over the constructor arguments, calling the accessor for each
- .local pmc iter
- iter = new 'Iterator', init_args
- iter = 0
+ .local pmc it
+ it = iter init_args
iter_loop:
- unless iter goto iter_end
- $S1 = shift iter
- $P1 = iter[$S1]
+ unless it goto iter_end
+ $S1 = shift it
+ $P1 = it[$S1]
self.$S1($P1)
goto iter_loop
iter_end:
Modified: trunk/t/op/sprintf.t
==============================================================================
--- trunk/t/op/sprintf.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/op/sprintf.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -87,7 +87,7 @@
.local pmc file_iterator # iterate over list of files..
- file_iterator = new 'Iterator', test_files
+ file_iterator = iter test_files
.local int test_number # the number of the test we're running
test_number = 0
@@ -478,16 +478,16 @@
.local pmc skip_os
skip_os = split ' ', skip_list
- .local pmc iter
- iter = new 'Iterator', skip_os
+ .local pmc it
+ it = iter skip_os
.local string osname
osname = sysinfo .SYSINFO_PARROT_OS
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string os_name
- os_name = shift iter
+ os_name = shift it
eq os_name, osname, skip_it
goto iter_loop
iter_end:
Modified: trunk/t/pmc/hash.t
==============================================================================
--- trunk/t/pmc/hash.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/hash.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -1204,18 +1204,18 @@
thash["c"] = "d"
thash["e"] = "f"
- .local pmc iter
- iter = new ['Iterator'], thash
- iter = .ITERATE_FROM_START
+ .local pmc it
+ it = iter thash
+ it = .ITERATE_FROM_START
.local pmc keys, key
keys = new ['ResizablePMCArray']
# go through the hash, print out all the keys: should be a c and e
preit_loop:
- unless iter goto preit_end
+ unless it goto preit_end
- key = shift iter
+ key = shift it
$S0 = key
push keys, $S0
@@ -1233,15 +1233,15 @@
# what do we have after deletion?
result = ""
- iter = new ['Iterator'], thash
- iter = .ITERATE_FROM_START
+ it = iter thash
+ it = .ITERATE_FROM_START
# go through the hash, print out all the keys... I believe it should be a and e?
# it actually outputs a, c and e.
postit_loop:
- unless iter goto postit_end
+ unless it goto postit_end
- key = shift iter
+ key = shift it
$S0 = key
push keys, $S0
Modified: trunk/t/pmc/io_iterator.t
==============================================================================
--- trunk/t/pmc/io_iterator.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/io_iterator.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -26,18 +26,18 @@
pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not yet implemented' );
.sub 'test' :main
$P99 = 1 # RT #46847 replace with io object
- $P0 = new ['Iterator'], $P99
- say "ok 1 - $P0 = new ['Iterator'], $P1"
+ $P0 = iter $P99
+ say "ok 1 - $P0 = iter $P1"
.end
CODE
-ok 1 - $P0 = new ['Iterator'], $P1
+ok 1 - $P0 = iter $P1
OUT
# L<PDD22/I\/O Iterator PMC API/=item shift>
pir_output_is( <<'CODE', <<'OUT', 'shift', todo => 'not yet implemented' );
.sub 'test' :main
$P99 = 1 # RT #46847 replace with io object
- $P0 = new ['Iterator'], $P99
+ $P0 = iter $P99
$S0 = shift $P0
@@ -56,7 +56,7 @@
pir_output_is( <<'CODE', <<'OUT', 'get_bool (vtable)', todo => 'not yet implemented' );
.sub 'test' :main
$P99 = 1 # RT #46847 replace with io object
- $P0 = new ['Iterator'], $P99
+ $P0 = iter $P99
# empty i/o object
unless $P0 goto ok_1
Modified: trunk/t/pmc/iterator.t
==============================================================================
--- trunk/t/pmc/iterator.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/iterator.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -23,9 +23,11 @@
=cut
+# XXX Split this test into aggregate specific one.
+
pasm_output_is( <<'CODE', <<'OUTPUT', "new iter" );
new P2, ['ResizablePMCArray']
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
end
CODE
@@ -39,19 +41,19 @@
push P2, 10
push P2, 20
set I0, P2
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
set I1, P1
eq I0, I1, ok2 # iter.length() == array.length()
print "not "
ok2: print "ok 2\n"
- new P1, ['Iterator'], P0
+ iter P1, P0
set P1, .ITERATE_FROM_START
print "ok 3\n"
unless P1, ok4 # if(iter) == false on empty
print "not "
ok4: print "ok 4\n"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
if P1, ok5 # if(iter) == true on non empty
print "not "
@@ -115,19 +117,19 @@
set P2["ab"], 100
set P2["xy"], "value"
set I0, P2
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
set I1, P1
eq I0, I1, ok2 # iter.length() == hash.length()
print "not "
ok2: print "ok 2\n"
- new P1, ['Iterator'], P0
+ iter P1, P0
set P1, .ITERATE_FROM_START
print "ok 3\n"
unless P1, ok4 # if(iter) == false on empty
print "not "
ok4: print "ok 4\n"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
if P1, ok5 # if(iter) == true on non empty
print "not "
@@ -169,19 +171,19 @@
set P2["ab"], 100
set P2["xy"], "value"
set I0, P2
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
set I1, P1
eq I0, I1, ok2 # iter.length() == hash.length()
print "not "
ok2: print "ok 2\n"
- new P1, ['Iterator'], P0
+ iter P1, P0
set P1, .ITERATE_FROM_START
print "ok 3\n"
unless P1, ok4 # if(iter) == false on empty
print "not "
ok4: print "ok 4\n"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
if P1, ok5 # if(iter) == true on non empty
print "not "
@@ -231,7 +233,7 @@
dec I1
if I1, fill
- new P1, ['Iterator'], P0
+ iter P1, P0
set I0, P1
eq I0, I10, ok1
print "not "
@@ -260,7 +262,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "parrot"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -281,7 +283,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "parrot"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_END
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -302,7 +304,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "ABC"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -323,7 +325,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "ABC"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_END
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -351,7 +353,7 @@
print "\n"
.local pmc iter_1
- iter_1 = new ['Iterator'], string_1
+ iter_1 = iter string_1
iter_1 = .ITERATE_FROM_START
.local int code_point_1
@@ -389,7 +391,7 @@
print "\n"
.local pmc iter_1
- iter_1 = new ['Iterator'], string_1
+ iter_1 = iter string_1
iter_1 = .ITERATE_FROM_START
.local int code_point_1
@@ -447,7 +449,7 @@
print "\n"
.local pmc iter_1
- iter_1 = new ['Iterator'], array_1
+ iter_1 = iter array_1
iter_1 = .ITERATE_FROM_START
.local string elem_1
@@ -502,7 +504,7 @@
print "\n"
.local pmc iter_2
- iter_2 = new ['Iterator'], array_1
+ iter_2 = iter array_1
iter_2 = .ITERATE_FROM_END
print 'Iterator shift_float: '
@@ -543,7 +545,7 @@
push P2, 20
push P2, 30
push P2, 40
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
set I0, P1 # arr.length
@@ -713,7 +715,7 @@
.local pmc ar, i1, i2
ar = new ['ResizableIntegerArray']
push ar, 17
- new i1, ['Iterator'], ar
+ i1 = iter ar
clone i2, i1
.end
CODE
@@ -726,7 +728,7 @@
push ar, 17
push ar, 42
- new i1, ['Iterator'], ar
+ i1 = iter ar
clone i2, i1
.local pmc temp
@@ -759,7 +761,7 @@
ar = new ['ResizableIntegerArray']
push ar, 1
push ar, 2
- new i1, ['Iterator'], ar
+ i1 = iter ar
shift temp, i1
unless temp == 1 goto fail
@@ -790,7 +792,7 @@
temp = new ['Integer']
ar = new ['ResizableIntegerArray']
push ar, 1
- new i1, ['Iterator'], ar
+ i1 = iter ar
# i1 and i2 now "point" to the same element of the same array.
clone i2, i1
Modified: trunk/t/pmc/namespace.t
==============================================================================
--- trunk/t/pmc/namespace.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/namespace.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -1699,13 +1699,13 @@
$P1 = 0
set_root_global [ "DUMMY"; "X"; "Y" ], "T0", $P0
- .local pmc dummy_x_y_ns, iter, res
+ .local pmc dummy_x_y_ns, it, res
dummy_x_y_ns = get_root_namespace [ "DUMMY"; "X"; "Y" ]
- iter = new ['Iterator'], dummy_x_y_ns
+ it = iter dummy_x_y_ns
res = new ['ResizablePMCArray']
loop:
- unless iter goto loop_end
- $S0 = shift iter
+ unless it goto loop_end
+ $S0 = shift it
push res, $S0
goto loop
loop_end:
@@ -1740,7 +1740,7 @@
say $P0
$I0 = elements $P0
say $I0
- new $P1 , 'Iterator', $P0
+ $P1 = iter $P0
L1:
unless $P1 goto L2
$P2 = shift $P1
Modified: trunk/t/pmc/object-mro.t
==============================================================================
--- trunk/t/pmc/object-mro.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/object-mro.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -44,7 +44,7 @@
subclass F, C, "F"
addparent F, D
mro = F.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -113,7 +113,7 @@
.local pmc mro, it, p
mro = A.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -183,7 +183,7 @@
.local pmc mro, it, p
mro = A.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -220,7 +220,7 @@
.local pmc mro, it, p
mro = D.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -279,7 +279,7 @@
.local pmc mro, it, p
mro = Vulcan.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
Modified: trunk/t/pmc/orderedhash.t
==============================================================================
--- trunk/t/pmc/orderedhash.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/orderedhash.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -89,7 +89,7 @@
set P1, "ok 3\n"
set P0["j"], P1
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START
iter_loop:
unless P2, end_iter
@@ -268,7 +268,7 @@
delete P0["a"]
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START_KEYS
iter_loop:
unless P2, end_iter
@@ -335,7 +335,7 @@
set P1, "ok 3\n"
set P0["j"], P1
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START_KEYS
iter_loop:
unless P2, end_iter
@@ -359,7 +359,7 @@
set P1, "ok 3\n"
set P0["j"], P1
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START_KEYS
iter_loop:
unless P2, end_iter
Modified: trunk/t/pmc/resizablepmcarray.t
==============================================================================
--- trunk/t/pmc/resizablepmcarray.t Tue Jul 21 12:16:59 2009 (r40190)
+++ trunk/t/pmc/resizablepmcarray.t Tue Jul 21 12:56:20 2009 (r40191)
@@ -703,7 +703,7 @@
.sub get_array_string
.param pmc p
$S0 = ''
- $P3 = new ['Iterator'], p
+ $P3 = iter p
loop:
unless $P3 goto loop_end
$P4 = shift $P3
@@ -833,7 +833,7 @@
#RT #40958 - can't iterate subclass of ResizablePMCArray
.sub iterate_subclass_of_rpa
- .local pmc arr, iter
+ .local pmc arr, it
$P0 = subclass 'ResizablePMCArray', 'MyArray'
arr = new ['MyArray']
@@ -844,10 +844,10 @@
is($I0, 3, "RPA subclass has correct element count")
$S1 = ''
- iter = new ['Iterator'], arr
+ it = iter arr
loop:
- unless iter goto end
- $P2 = shift iter
+ unless it goto end
+ $P2 = shift it
$S0 = $P2
concat $S1, $S0
concat $S1, ","
More information about the parrot-commits
mailing list