Help with lang filter definition
Brought to you by:
alnd
I have a source code as following:
const SWORD table[10] =
{
/* cmt */ A=B;
/* cmt */ X=Y;
/* cmt1,
cmt2 */
} /*
cmt1,
cmt2 */;
When I use cloc to count, it shows 5 LOCs.However, it should be 3 LOCs only (which are:const SWORD table[10] =, A=B;, and X=Y;)
Are there any ways to solve this problem?Can it be solved by using lang filter?Thank you.
Anonymous
cloc counts any non-commented, non-blank line as being a line of code. Therefore your lines of { and } are counted as code. The following language definitions for C, C#, C++, and C header files will count lines of just { or } as comments rather than code (there is not a way to simply ignore { or } ):
With this filter, I see that the ELOC is still 4 instead of 3. I think that it is caused by the semicolon in last line. Is there anyway to solve it?
With this language definition, I see that the LOC is still 4 instead of 3. I think it is caused by semicolon (;) in the last line of source code. Is there any way to solve it? Thank you