[svn:parrot] r38660 - branches/pmc_pct/compilers/pmcc/src/emitter

bacek at svn.parrot.org bacek at svn.parrot.org
Sat May 9 23:54:33 UTC 2009


Author: bacek
Date: Sat May  9 23:54:33 2009
New Revision: 38660
URL: https://trac.parrot.org/parrot/changeset/38660

Log:
Sligtly better c_body emitting

Modified:
   branches/pmc_pct/compilers/pmcc/src/emitter/c.pir

Modified: branches/pmc_pct/compilers/pmcc/src/emitter/c.pir
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/emitter/c.pir	Sat May  9 23:37:19 2009	(r38659)
+++ branches/pmc_pct/compilers/pmcc/src/emitter/c.pir	Sat May  9 23:54:33 2009	(r38660)
@@ -23,6 +23,35 @@
 
 .sub 'emit'
     .param pmc entry
+    .tailcall '!generate_children_body_part'(entry)
+.end
+
+=item C<!generate_body_part>
+
+Multi-methods for generating C body.
+
+TODO: Parse c_body properly and implement all other functions.
+
+=cut
+
+.sub '!generate_body_part' :multi(['PAST';'Op'])
+    .param pmc past
+    $S0 = past['inline']
+    .return ($S0)
+.end
+
+.sub '!generate_body_part' :multi(['PAST';'Stmts'])
+    .param pmc past
+    .local string res
+    res = "{\n"
+    $S0 = '!generate_children_body_part'(past)
+    concat res, $S0
+    concat res, "}\n"
+    .return (res)
+.end
+
+.sub '!generate_children_body_part'
+    .param pmc entry
     
     .local pmc res
     res = new 'ResizableStringArray'
@@ -41,20 +70,6 @@
     .return ($S0)
 .end
 
-=item C<!generate_body_part>
-
-Multi-methods for generating C body.
-
-TODO: Parse c_body properly and implement all other functions.
-
-=cut
-
-.sub '!generate_body_part' :multi(['PAST';'Op'])
-    .param pmc past
-    $S0 = past['inline']
-    .return ($S0)
-.end
-
 
 
 # Local Variables:


More information about the parrot-commits mailing list