boyter / scc

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
MIT License
6.28k stars 250 forks source link

RISCV assembly - can't count comments #429

Closed rcordeau closed 4 months ago

rcordeau commented 4 months ago

Describe the bug Trying to compare against sloccount, and scc's ability to accurately count riscv assembly is off. It doesn't factor out comments (it can't see them)

To Reproduce scc as a command ./scc asm_f.S

/****\

include "thread_def.h"

.global ASM_ReturnToUserThread

Expected behavior I expected an accurate count. of 2, but I got 7

Linux Ubuntu 22.04

boyter commented 4 months ago

Yeah, .s would be picked up as Assembly and according to the rules https://github.com/boyter/scc/blob/master/languages.json#L414 there is noting for multiline comments.

Ill add it in now. You can get this if you build from source but with the new Go release ill be crafting a new build soon.

boyter commented 4 months ago

Build from source should resolve this. Otherwise give it a few days and ill push out a new release.