Skip to content

Commit

Permalink
refine Civet coffeeComment logic (redo), #873
Browse files Browse the repository at this point in the history
  • Loading branch information
AlDanial committed Dec 21, 2024
1 parent d05463a commit a880db2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
5 changes: 2 additions & 3 deletions Unix/cloc
Original file line number Diff line number Diff line change
Expand Up @@ -12022,9 +12022,8 @@ sub call_parse_civet { # {{{1
}
my (@step_1, @step_2, @step_3, @step_4);
if ($coffeeComment) {
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_between_general(\@step_1, '###', '###');
@step_4 = remove_matches( \@step_2, '^\s*#');
@step_1 = remove_between_general($ra_lines, '###', '###');
@step_4 = remove_matches( \@step_1, '^\s*#');
} else {
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_matches( \@step_1, '^///');
Expand Down
5 changes: 2 additions & 3 deletions cloc
Original file line number Diff line number Diff line change
Expand Up @@ -12012,9 +12012,8 @@ sub call_parse_civet { # {{{1
}
my (@step_1, @step_2, @step_3, @step_4);
if ($coffeeComment) {
@step_1 = call_regexp_common($ra_lines, 'C');
@step_2 = remove_between_general(\@step_1, '###', '###');
@step_4 = remove_matches( \@step_2, '^\s*#');
@step_1 = remove_between_general($ra_lines, '###', '###');
@step_4 = remove_matches( \@step_1, '^\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.00477790832519531
elapsed_seconds : 0.00392413139343262
n_files : 1
n_lines : 37
files_per_second : 209.296606786427
lines_per_second : 7743.9744510978
files_per_second : 254.833464973571
lines_per_second : 9428.83820402211
report_file : tests/outputs/parser_2.civet.yaml
'Civet' :
nFiles: 1
blank: 4
comment: 14
code: 19
comment: 10
code: 23
SUM:
blank: 4
comment: 14
code: 19
comment: 10
code: 23
nFiles: 1

0 comments on commit a880db2

Please sign in to comment.