[svn:parrot] r44795 - branches/ops_pct/compilers/opsc/src/Ops/Trans

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Mar 9 06:59:32 UTC 2010


Author: bacek
Date: Tue Mar  9 06:59:31 2010
New Revision: 44795
URL: https://trac.parrot.org/parrot/changeset/44795

Log:
Generate code closer to ops2c.

Modified:
   branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm

Modified: branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm
==============================================================================
--- branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm	Tue Mar  9 06:59:09 2010	(r44794)
+++ branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm	Tue Mar  9 06:59:31 2010	(r44795)
@@ -188,7 +188,7 @@
     my $index := 0;
 
     for $emitter.ops_file.ops -> $op {
-        my $type := sprintf( "PARROT_%s_OP", uc($op.type) );
+        my $type := sprintf( "PARROT_%s_OP", uc(~$op.type) );
         my $name := $op.name;
         %names{$name} := 1;
         my $full_name := $op.full_name;
@@ -202,7 +202,7 @@
             ?? '{ ' ~ join( ", ",
                 |map( -> $t { sprintf( "PARROT_ARG_%s", uc($t) ) }, $op.arg_types)
             ) ~ ' }'
-            !! ' { (arg_type_t) 0 }';
+            !! '{ (arg_type_t) 0 }';
         my $arg_dirs := $op<normalized_args>
             ?? '{ ' ~ join(", ",
                 |map( -> $d { %arg_dir_mapping{$d<direction>} }, $op<normalized_args>)
@@ -214,8 +214,7 @@
             ) ~ ' }'
             !! '{ 0 }';
 
-        $fh.print('{' ~ qq|
-   /* $index */
+        $fh.print('{ ' ~ qq|/* $index */
     /* type $type, */
     "$name",
     "$full_name",
@@ -226,7 +225,8 @@
     $arg_types,
     $arg_dirs,
     $labels
-  | ~ '},',
+  | ~ '},
+',
             );
 
             $index++;


More information about the parrot-commits mailing list