[or-cvs] correct multiple internal spaces
Nick Mathewson
nickm at seul.org
Sun Nov 28 09:14:10 UTC 2004
Update of /home/or/cvsroot/tor/contrib
In directory moria.mit.edu:/tmp/cvs-serv12136/contrib
Modified Files:
checkSpace.pl
Log Message:
correct multiple internal spaces
Index: checkSpace.pl
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/checkSpace.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- checkSpace.pl 28 Nov 2004 09:05:45 -0000 1.4
+++ checkSpace.pl 28 Nov 2004 09:14:05 -0000 1.5
@@ -40,13 +40,13 @@
}
}
if (m!/\*.*?\*/!) {
- s!/\*.*?\*/!!;
+ s!\s*/\*.*?\*/!!;
} elsif (m!/\*!) {
- s!/\*!!;
+ s!\s*/\*!!;
$incomment = 1;
next;
}
- s!"(?:[^\"]+|\\.)*"!!g;
+ s!"(?:[^\"]+|\\.)*"!"X"!g;
next if /^\#/;
## Warn about C++-style comments.
if (m!//!) {
@@ -57,16 +57,8 @@
if (/([^\s])\{/) {
print " $1\{:$fn:$.\n";
}
- ## Warn about function calls with space before parens.
- if (/(\w+)\s\(/) {
- if ($1 ne "if" and $1 ne "while" and $1 ne "for" and
- $1 ne "switch" and $1 ne "return" and $1 ne "int" and
- $1 ne "void" and $1 ne "__attribute__") {
- print " fn ():$fn:$.\n";
- }
- }
## Warn about multiple internal spaces.
- #if (/\S\s{2,}[^\s\\]/) {
+ #if (/[^\s,:]\s{2,}[^\s\\=]/) {
# print " X X:$fn:$.\n";
#}
## Warn about { with stuff after.
@@ -74,6 +66,14 @@
#if (/\{[^\}\\]+$/) {
# print " {X:$fn:$.\n";
#}
+ ## Warn about function calls with space before parens.
+ if (/(\w+)\s\(/) {
+ if ($1 ne "if" and $1 ne "while" and $1 ne "for" and
+ $1 ne "switch" and $1 ne "return" and $1 ne "int" and
+ $1 ne "void" and $1 ne "__attribute__") {
+ print " fn ():$fn:$.\n";
+ }
+ }
}
close(F);
}
More information about the tor-commits
mailing list