4 ms·
Have a look at the tests in scc and tokei. They support nested multiline comments, string escapes and other odd language features. As such both get very close t
by boyter 7y ago
Have a look at the tests in scc and tokei. They support nested multiline comments, string escapes and other odd language features. As such both get very close to counting lines the way a full tokeniser used by the compiler or interpreter do making them very accurate.
I see your point. I’d argue however the rules for counting should be language rules not some higher level generic set.
- OnlyOneCannolo 7y agoAh, now I see what you mean by 'accuracy'. Each language does have its own counting rules. There's a separate PDF for each one describing the rules for that language, which is the cool part.