Author: pmichaud
Date: Sun Nov 9 10:46:40 2008
New Revision: 32470
Modified:
trunk/compilers/pct/src/PAST/Compiler.pir
Log:
[pct]: Recognize arity of while/until blocks.
Modified: trunk/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/PAST/Compiler.pir (original)
+++ trunk/compilers/pct/src/PAST/Compiler.pir Sun Nov 9 10:46:40 2008
@@ -1044,11 +1044,19 @@
exprrtype = '*'
have_exprrtype:
- ops.'push'(looplabel)
exprpost = self.'as_post'(exprpast, 'rtype'=>exprrtype)
+
+ .local pmc arglist
+ arglist = new 'ResizablePMCArray'
+ $I0 = bodypast.'arity'()
+ unless $I0 goto have_arglist
+ push arglist, exprpost
+ have_arglist:
+
+ ops.'push'(looplabel)
ops.'push'(exprpost)
ops.'push_pirop'(iftype, exprpost, endlabel)
- bodypost = self.'as_post'(bodypast, 'rtype'=>'v')
+ bodypost = self.'as_post'(bodypast, 'rtype'=>'v', 'arglist'=>arglist)
ops.'push'(bodypost)
ops.'push_pirop'('goto', looplabel)
ops.'push'(endlabel)