Author: pmichaud
Date: Sun Dec 28 09:51:31 2008
New Revision: 34504
Modified:
branches/rvar/compilers/pct/src/PAST/Compiler.pir
Log:
[pct]: Add :pasttype('stmts').
Modified: branches/rvar/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/rvar/compilers/pct/src/PAST/Compiler.pir (original)
+++ branches/rvar/compilers/pct/src/PAST/Compiler.pir Sun Dec 28 09:51:31 2008
@@ -584,7 +584,7 @@
=cut
-.sub 'as_post' :method :multi(_, ['PAST';'Node'])
+.sub 'as_post' :method :multi(_, ['PAST';'Node']) :subid('Node.as_post')
.param pmc node
.param pmc options :slurpy :named
@@ -1510,6 +1510,22 @@
.end
+=item stmts(PAST::Op node)
+
+Treat the node like a PAST::Stmts node -- i.e., invoke all the
+children and return the value of the last one.
+
+=cut
+
+.sub 'stmts' :method :multi(_, ['PAST';'Op'])
+ .param pmc node
+ .param pmc options :slurpy :named
+
+ .const 'Sub' $P0 = 'Node.as_post'
+ .tailcall self.$P0(node, options :flat :named)
+.end
+
+
=item return(PAST::Op node)
Generate a return exception, using the first child (if any) as