More detailed data from the output for 'Syntax check'

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Axeman
User
User
Posts: 89
Joined: Mon Nov 03, 2003 5:34 am

More detailed data from the output for 'Syntax check'

Post by Axeman »

Sometimes I like to know how much code there is in a given project and how much new code I've added in a day's coding. It would be useful to have a fast and easy way to obtain the total number of lines in a project, the number of pure code lines, and the number of code lines plus comments. And perhaps also the number of code statements.

The 'Syntax check' option in the 'Compiler' menu shows the number of lines in the project being checked, but this includes blank lines and comment lines. Comment lines involve some degree of work so it can be useful to see the number of them, but knowing the number of blank lines generally isn't useful data.

This is an example of what the output from 'Syntax check' might currently show:-
[10:49:57] [COMPILER] Syntax check finished (1000 lines)

This is an example of what I'd like to see from it:-
[10:49:57] [COMPILER] Syntax check finished (1000 lines total) (700 lines code only) (100 lines comment only) (900 statements)
BarryG
Addict
Addict
Posts: 3322
Joined: Thu Apr 18, 2019 8:17 am

Re: More detailed data from the output for 'Syntax check'

Post by BarryG »

Axeman wrote: Mon Nov 08, 2021 1:15 amthis includes blank lines and comment lines [...] knowing the number of blank lines generally isn't useful data
I recently requested an "actual code lines only" count here -> viewtopic.php?f=3&t=77924

But I was mocked and told it involves a two-pass compile (it doesn't). Good luck with your request.
User avatar
Tenaja
Addict
Addict
Posts: 1949
Joined: Tue Nov 09, 2010 10:15 pm

Re: More detailed data from the output for 'Syntax check'

Post by Tenaja »

BarryG wrote: Mon Nov 08, 2021 1:21 am
Axeman wrote: Mon Nov 08, 2021 1:15 amthis includes blank lines and comment lines [...] knowing the number of blank lines generally isn't useful data
I recently requested an "actual code lines only" count here -> viewtopic.php?f=3&t=77924

But I was mocked and told it involves a two-pass compile (it doesn't). Good luck with your request.
My "nay saying" comment in your thread was specifically regarding code-only line counts in the "compiling dialog box"... Which I Presumed was requested for the progress bar, rather than the "completed" place. In the case of the former, unless you count the "code only" lines ahead of time, you cannot give a progress bar based on "code only" lines.

There are no added steps to adding that count to the syntax-check feature, or to the completion data... Just keeping track and displaying the data.

If I misread your intent of "the compiling dialog box," then I apologize!
BarryG
Addict
Addict
Posts: 3322
Joined: Thu Apr 18, 2019 8:17 am

Re: More detailed data from the output for 'Syntax check'

Post by BarryG »

Tenaja, I've posted in the other thread so as not to hijack this one. And no, you didn't mock me.
Post Reply