tokei icon indicating copy to clipboard operation
tokei copied to clipboard

Blank lines in multiline comments counted as blanks

Open alekratz opened this issue 6 years ago • 2 comments

If a multiline comment contains blank lines, those lines get counted as "blank" instead of being part of the multiline comment. For example:

/* blank lines follow







   */

will yield this output (using .rs extension for sake of example):

 Language                          Files        Lines         Code     Comments       Blanks
---------------------------------------------------------------------------------------------
 Rust                                  1            9            0            2            7

Is this intended behavior? While the lines are technically blank, they are also a part of the multiline comment.

alekratz avatar Oct 11 '18 19:10 alekratz

Thank you for this issue. While I can see the case for them being comments the question I would wonder if syntactically are these blank lines significant in any language, such that counting them as blanks is an unintuitive behaviour?

XAMPPRocky avatar Oct 20 '18 12:10 XAMPPRocky

I think those blank lines should still be comments.

Blank lines in strings should also be counted as code.

My argument is: it is just like how people put {, }, [, ], (, ) on a single line (and lose some contests!) no matter how insignificant it seems.

echo '{
 M
  Y

     S
      T
       Y
        L
         E
}'

Blank lines in comments can also be used by document generators (e.g. as divider) but still is part of the comments.

jakwings avatar Oct 29 '19 05:10 jakwings