develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34504 - branches/rvar/compilers/pct/src/PAST

From:
pmichaud
Date:
December 28, 2008 09:51
Subject:
[svn:parrot] r34504 - branches/rvar/compilers/pct/src/PAST
Message ID:
20081228175131.DDED1CB9FA@x12.develooper.com
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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About