summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid A. Wheeler <dwheeler@dwheeler.com>2014-02-04 18:57:15 -0500
committerDavid A. Wheeler <dwheeler@dwheeler.com>2014-02-04 18:57:15 -0500
commit18bd6698369e705cad41d0d658064e89585a235d (patch)
tree342cc6f48949f98550a841371daca057f003652a
parent33e78e34e60c9fc6bd06bf0f43630b4bb539c589 (diff)
downloadsloccount-git-18bd6698369e705cad41d0d658064e89585a235d.tar.gz
Ignore //comments in objective-C; proposal per Robert Stein
- Robert Stein noted the need to not count //-lines in Objective-C. This code is based on code from Robert Stein.
-rwxr-xr-xobjc_count3
1 files changed, 2 insertions, 1 deletions
diff --git a/objc_count b/objc_count
index a74bd5b..2ba19f7 100755
--- a/objc_count
+++ b/objc_count
@@ -68,9 +68,10 @@ sub count_file {
while (<FILE>) {
if ($incomment) {
if (m/\*\//) { s/^.*?\*\///; $incomment = 0;}
- else { s/.*//; }
+ else { s/.*//; }
}
if (!$incomment) {
+ if (m/^\s*\/\//) { s/.*$//; }
# s/\/\*.*?\*\//g;
s!\/\*.*?\*\/!!g;
if (m/\/\*/) {