~yujiri/counter

code counter that counts tokens instead of lines

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~yujiri/counter
read/write
git@git.sr.ht:~yujiri/counter

You can also use your local clone with git send-email.

Code counter that counts syntax tokens instead of lines. Paul Graham suggested this in an article I read years ago and I liked it, now I decided to throw one together for Zig.

Of course the downside is it has to be language-specific.

Currently it walks all given paths and counts only .zig files. Missing features:

  • Ignoring zig-cache, zig-out, etc. Maybe: read folders to ignore from .gitignore.

  • Counting test blocks separately.

  • Good error reporting.

  • Maybe do something about links?

Things that currently count as tokens, but I'm not sure should:

  • Semicolons

  • Braces

  • Colons in type signatures

My argument against counting these things is that there are languages that don't have them, and I'm not sure code in those languages should be advantaged because of that.