Open lucamug opened 3 years ago
Yes, this is an anticipated bug with roots back to SLOCCount, ref the comment block for function remove_haskell_comments()
(which is included as an Elm filter) beginning at
https://github.com/AlDanial/cloc/blob/9b1c380fdad27bcf9e86e5884467167b51873adf/cloc#L7361. It is the {-
inside the string that the code doesn't account for. I'll have to add logic to see if comment markers are inside a string.
Take your time. For the moment I just added a space between {
and -
(that is still valid CSS) 😊
Well, I did take my time :) I reran the original case reported as showing 3 lines instead of 4. cloc 1.98 reports the answer is 4 although I don't recall actively changing anything for Elm since then. Can you try with the latest cloc?
@lucamug can you check to see if your original Elm counting edge case still exists with latest cloc?
The following line of Elm code make the counter to stop the count:
For example, this file 4 lines of code are reported correctly:
But for this file, still 4 lines of code are reported, wrongly.
The culprit seems being
{-}
, or a similar string where the dash can be followed by any character, like{-xxx}
.