Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (13 sloc) 389 Bytes
#!/usr/bin/env perl
my $s = join( '', <STDIN> );
# remove comments
$s =~ s¦/\*[^*]*\*+([^/][^*]*\*+)*/¦¦g;
# remove newlines and white space at the beginning and at the end of lines
$s =~ s/[\t ]*[\r\n]+[\t ]*//g;
# condense tabs and blanks
$s =~ s/[\t ]+/ /g;
# remove unnecessary blanks
$s =~ s/[ ]+\{/{/g;
$s =~ s/([:\(\{,;])[ ]+/\1/g;
$s =~ s/[ ]+([\)\}])/\1/g;
print $s . "\n";
Jump to Line
Something went wrong with that request. Please try again.