Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to count tokens instead of lines or characters #389

Closed
eyalroz opened this issue May 13, 2019 · 1 comment
Closed

Option to count tokens instead of lines or characters #389

eyalroz opened this issue May 13, 2019 · 1 comment

Comments

@eyalroz
Copy link

eyalroz commented May 13, 2019

After reading #234, it immediately occurred to me it that parsed tokens are a more valid measure of code size than characters. After all,

my_value = perform_some_actions();

is the same thing as

v = do_stuff();

I realize this is a tall order and perhaps out-of-scope for this project, but - I'll just put it out there.

@AlDanial
Copy link
Owner

Theoretically it's a fine idea. However cloc does not parse languages; it is strictly regular-expression based. For this reason, character counting is possible (although unlikely to be implemented in the foreseeable future), but counting tokens is not. You'll need a smarter counter than cloc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants