[svn:parrot] r46845 - branches/ops_pct/compilers/opsc

cotto at svn.parrot.org cotto at svn.parrot.org
Fri May 21 07:13:31 UTC 2010


Author: cotto
Date: Fri May 21 07:13:31 2010
New Revision: 46845
URL: https://trac.parrot.org/parrot/changeset/46845

Log:
[opsc] add --debug to ops2c to disable file output

Modified:
   branches/ops_pct/compilers/opsc/ops2c.nqp

Modified: branches/ops_pct/compilers/opsc/ops2c.nqp
==============================================================================
--- branches/ops_pct/compilers/opsc/ops2c.nqp	Fri May 21 07:12:43 2010	(r46844)
+++ branches/ops_pct/compilers/opsc/ops2c.nqp	Fri May 21 07:13:31 2010	(r46845)
@@ -21,6 +21,10 @@
 $arg.type('String');
 
 $arg := $getopts.add();
+$arg.long('debug');
+$arg.short('g');
+
+$arg := $getopts.add();
 $arg.long('no-lines');
 $arg.short('n');
 
@@ -67,6 +71,7 @@
 
 my $trans := Ops::Trans::C.new();
 my $start_time := pir::time__N();
+my $debug :=  ?$opts<debug>;
 my $f;
 my $renum;
 
@@ -95,7 +100,9 @@
     :flags( hash( core => $core ) ),
 );
 
-$emitter.print_c_header_files();
-$emitter.print_c_source_file();
+unless $debug {
+    $emitter.print_c_header_files();
+    $emitter.print_c_source_file();
+}
 
 # vim: expandtab shiftwidth=4 ft=perl6:


More information about the parrot-commits mailing list