Skip to content

Commit

Permalink
refine Civet coffeeComment logic, #873
Browse files Browse the repository at this point in the history
  • Loading branch information
AlDanial committed Dec 21, 2024
1 parent 0563ada commit d05463a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Unix/cloc
Original file line number Diff line number Diff line change
Expand Up @@ -12022,7 +12022,9 @@ sub call_parse_civet { # {{{1
}
my (@step_1, @step_2, @step_3, @step_4);
if ($coffeeComment) {
@step_4 = remove_matches($ra_lines, '^\s*#');
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_between_general(\@step_1, '###', '###');
@step_4 = remove_matches( \@step_2, '^\s*#');
} else {
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_matches( \@step_1, '^///');
Expand Down
4 changes: 3 additions & 1 deletion cloc
Original file line number Diff line number Diff line change
Expand Up @@ -12012,7 +12012,9 @@ sub call_parse_civet { # {{{1
}
my (@step_1, @step_2, @step_3, @step_4);
if ($coffeeComment) {
@step_4 = remove_matches($ra_lines, '^\s*#');
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_between_general(\@step_1, '###', '###');
@step_4 = remove_matches( \@step_2, '^\s*#');
} else {
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_matches( \@step_1, '^///');
Expand Down
14 changes: 7 additions & 7 deletions tests/outputs/parser_2.civet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.03
elapsed_seconds : 0.00371313095092773
elapsed_seconds : 0.00477790832519531
n_files : 1
n_lines : 37
files_per_second : 269.31449852318
lines_per_second : 9964.63644535765
files_per_second : 209.296606786427
lines_per_second : 7743.9744510978
report_file : tests/outputs/parser_2.civet.yaml
'Civet' :
nFiles: 1
blank: 4
comment: 9
code: 24
comment: 14
code: 19
SUM:
blank: 4
comment: 9
code: 24
comment: 14
code: 19
nFiles: 1

0 comments on commit d05463a

Please sign in to comment.