c2english: Remove spaces before and after initializer braces

* modules/c2english: Remove trailing whitespace
* modules/c2english: Remove spaces before and after initializer braces
This commit is contained in:
Joey Pabalinas 2018-04-24 11:22:05 -10:00 committed by Pragmatic Software
parent 585bcc0092
commit fa4a71699a
2 changed files with 354 additions and 354 deletions

File diff suppressed because it is too large Load Diff

View File

@ -14,16 +14,16 @@ use Getopt::Std;
use Data::Dumper; use Data::Dumper;
our ($opt_T, $opt_t, $opt_o, $opt_P); our ($opt_T, $opt_t, $opt_o, $opt_P);
getopts('TPto:'); getopts('TPto:');
if ($opt_T ) { if ($opt_T ) {
$::RD_TRACE = 1; $::RD_TRACE = 1;
} else { } else {
undef $::RD_TRACE ; undef $::RD_TRACE ;
} }
$::RD_HINT = 1; $::RD_HINT = 1;
$Parse::RecDescent::skip = '\s*'; $Parse::RecDescent::skip = '\s*';
my $parser; my $parser;
@ -34,13 +34,13 @@ if($opt_P or !eval { require PCGrammar }) {
$parser = PCGrammar->new() or die "Bad grammar!\n"; $parser = PCGrammar->new() or die "Bad grammar!\n";
if ($opt_o) { if ($opt_o) {
open(OUTFILE, ">>$opt_o"); open(OUTFILE, ">>$opt_o");
*STDOUT = *OUTFILE{IO}; *STDOUT = *OUTFILE{IO};
} }
my $text = ""; my $text = "";
foreach my $arg (@ARGV) { foreach my $arg (@ARGV) {
print STDERR "Opening file $arg\n"; print STDERR "Opening file $arg\n";
open(CFILE, "$arg") or die "Could not open $arg.\n"; open(CFILE, "$arg") or die "Could not open $arg.\n";
@ -48,14 +48,14 @@ foreach my $arg (@ARGV) {
$text = <CFILE>; $text = <CFILE>;
close(CFILE); close(CFILE);
print STDERR "parsing...\n"; print STDERR "parsing...\n";
# for debugging... # for debugging...
if ($opt_t) { if ($opt_t) {
$::RD_TRACE = 1; $::RD_TRACE = 1;
} else { } else {
undef $::RD_TRACE; undef $::RD_TRACE;
} }
my $result = $parser->startrule(\$text) or die "Bad text!\n$text\n"; my $result = $parser->startrule(\$text) or die "Bad text!\n$text\n";
@ -88,7 +88,7 @@ foreach my $arg (@ARGV) {
$output =~ s/,\././g; $output =~ s/,\././g;
$output =~ s/of unspecified length //g; $output =~ s/of unspecified length //g;
while($output =~ s/const const/const/g){}; while($output =~ s/const const/const/g){};
foreach my $quote (@quotes) { foreach my $quote (@quotes) {
next unless $quote; next unless $quote;
$output =~ s/"-+"/"$quote"/; $output =~ s/"-+"/"$quote"/;