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

Lazarus (Free Pascal) project CudaText, missed .inc files #708

Closed
Alexey-T opened this issue Jan 29, 2021 · 5 comments
Closed

Lazarus (Free Pascal) project CudaText, missed .inc files #708

Alexey-T opened this issue Jan 29, 2021 · 5 comments

Comments

@Alexey-T
Copy link

Alexey-T commented Jan 29, 2021

project
https://github.com/Alexey-T/CudaText

folder app/

===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 ASP                     4           40           24            0           16
 C                       2           28            6           16            6
 C++                     2           14           12            0            2
 CSS                     4         2516         2510            6            0
 INI                    14         6590         6140          114          336
 JavaScript              2            6            4            2            0
 JSON                   36         5224         4660            0          564
 Pascal                 44        34984        29276         1535         4173
 PHP                     4           38           24            0           14
 Python                337       167943       150846         7215         9882
 SVG                    24           24           24            0            0
 Plain Text             87         7386            0         6430          956
 VBScript                2            8            4            4            0
 XSL                     2           16           10            0            6
 XML                     2            4            2            0            2
-------------------------------------------------------------------------------
 HTML                   12         1240         1072           56          112
 |- JavaScript           2            6            4            2            0
 (Total)                           1246         1076           58          112
===============================================================================
 Total                 578       226061       194614        15378        16069
===============================================================================

tool says- 44 pascal files

OK- folder app/ has 44 files .pas .lpr .lpi
bad- folder has ALSO 18 PASCAL FILES *.inc which are include files-- missed!

.inc files are NOT always pascal files. they are if they are in Lazarus or Delphi projects.

@Alexey-T Alexey-T changed the title Bad calculation of lines for Lazarus (Free Pascal) project CudaText Bad calculation of lines for Lazarus (Free Pascal) project CudaText, missed .inc files Jan 29, 2021
@Alexey-T
Copy link
Author

Alexey-T commented Jan 29, 2021

NOTE: to find .inc files, find the lines

    {$I filename.inc}
    {$I dir1/dir2/filename.inc}
    {$I ../dir3/fname.inc}
    {$i dir1\dir2\fname.inc} //Windows slash

in pascal files. one .inc file can include another .inc file.
these {$I} lines can be in lowercasee {$i}.
they can be inside pascal code like any {....} pascal comment.

some_func(2); {$i ../fname.inc}; some_more;

@Alexey-T
Copy link
Author

Alexey-T commented Jan 29, 2021

@Artem3213212 @dinkumoil @vhanla @iRamSoft Support pls.

@Alexey-T Alexey-T changed the title Bad calculation of lines for Lazarus (Free Pascal) project CudaText, missed .inc files Lazarus (Free Pascal) project CudaText, missed .inc files Jan 29, 2021
@XAMPPRocky
Copy link
Owner

XAMPPRocky commented Jan 30, 2021

Thank you for your issue! However as you've mentioned .inc isn't always pascal, and indeed many other languages have conventions of using .inc. Tokei does not use the contents of the file to detect the language, I'd rather not count it at all, than miscount a language as another. A potential future solution will be #67 which will allow to set .inc to be counted as whatever language you prefer, but in the meantime you can always give those files double extensions (e.g. .inc.pas) and tokei will count them correctly.

@Alexey-T
Copy link
Author

Tokei does not use the contents of the file to detect the language

It's a misfeature

@XAMPPRocky
Copy link
Owner

That’s your opinion, however I am unconvinced, I prefer the deterministic nature of the current implementation. You can always use another code counter such as cloc or others, that use a different detection algorithm.

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