correct multiple internal spaces

svn:r3004
This commit is contained in:
Nick Mathewson 2004-11-28 09:14:07 +00:00
parent 6f5dbefa7e
commit f7c6ad065e
3 changed files with 15 additions and 15 deletions

View File

@ -40,13 +40,13 @@ for $fn (@ARGV) {
} }
} }
if (m!/\*.*?\*/!) { if (m!/\*.*?\*/!) {
s!/\*.*?\*/!!; s!\s*/\*.*?\*/!!;
} elsif (m!/\*!) { } elsif (m!/\*!) {
s!/\*!!; s!\s*/\*!!;
$incomment = 1; $incomment = 1;
next; next;
} }
s!"(?:[^\"]+|\\.)*"!!g; s!"(?:[^\"]+|\\.)*"!"X"!g;
next if /^\#/; next if /^\#/;
## Warn about C++-style comments. ## Warn about C++-style comments.
if (m!//!) { if (m!//!) {
@ -57,6 +57,15 @@ for $fn (@ARGV) {
if (/([^\s])\{/) { if (/([^\s])\{/) {
print " $1\{:$fn:$.\n"; print " $1\{:$fn:$.\n";
} }
## Warn about multiple internal spaces.
#if (/[^\s,:]\s{2,}[^\s\\=]/) {
# print " X X:$fn:$.\n";
#}
## Warn about { with stuff after.
#s/\s+$//;
#if (/\{[^\}\\]+$/) {
# print " {X:$fn:$.\n";
#}
## Warn about function calls with space before parens. ## Warn about function calls with space before parens.
if (/(\w+)\s\(/) { if (/(\w+)\s\(/) {
if ($1 ne "if" and $1 ne "while" and $1 ne "for" and if ($1 ne "if" and $1 ne "while" and $1 ne "for" and
@ -65,15 +74,6 @@ for $fn (@ARGV) {
print " fn ():$fn:$.\n"; print " fn ():$fn:$.\n";
} }
} }
## Warn about multiple internal spaces.
#if (/\S\s{2,}[^\s\\]/) {
# print " X X:$fn:$.\n";
#}
## Warn about { with stuff after.
#s/\s+$//;
#if (/\{[^\}\\]+$/) {
# print " {X:$fn:$.\n";
#}
} }
close(F); close(F);
} }