diff options
author | David A. Wheeler <dwheeler@dwheeler.com> | 2014-02-04 18:57:15 -0500 |
---|---|---|
committer | David A. Wheeler <dwheeler@dwheeler.com> | 2014-02-04 18:57:15 -0500 |
commit | 18bd6698369e705cad41d0d658064e89585a235d (patch) | |
tree | 342cc6f48949f98550a841371daca057f003652a | |
parent | 33e78e34e60c9fc6bd06bf0f43630b4bb539c589 (diff) | |
download | sloccount-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-x | objc_count | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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/\/\*/) { |