Skip to content

Commit a880db2

Browse files
committed
refine Civet coffeeComment logic (redo), #873
1 parent d05463a commit a880db2

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

Unix/cloc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12022,9 +12022,8 @@ sub call_parse_civet { # {{{1
1202212022
}
1202312023
my (@step_1, @step_2, @step_3, @step_4);
1202412024
if ($coffeeComment) {
12025-
@step_1 = call_regexp_common($ra_lines, 'C');
12026-
@step_2 = remove_between_general(\@step_1, '###', '###');
12027-
@step_4 = remove_matches( \@step_2, '^\s*#');
12025+
@step_1 = remove_between_general($ra_lines, '###', '###');
12026+
@step_4 = remove_matches( \@step_1, '^\s*#');
1202812027
} else {
1202912028
@step_1 = call_regexp_common($ra_lines, 'C');
1203012029
@step_2 = remove_matches( \@step_1, '^///');

cloc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12012,9 +12012,8 @@ sub call_parse_civet { # {{{1
1201212012
}
1201312013
my (@step_1, @step_2, @step_3, @step_4);
1201412014
if ($coffeeComment) {
12015-
@step_1 = call_regexp_common($ra_lines, 'C');
12016-
@step_2 = remove_between_general(\@step_1, '###', '###');
12017-
@step_4 = remove_matches( \@step_2, '^\s*#');
12015+
@step_1 = remove_between_general($ra_lines, '###', '###');
12016+
@step_4 = remove_matches( \@step_1, '^\s*#');
1201812017
} else {
1201912018
@step_1 = call_regexp_common($ra_lines, 'C');
1202012019
@step_2 = remove_matches( \@step_1, '^///');

tests/outputs/parser_2.civet.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
header :
44
cloc_url : github.com/AlDanial/cloc
55
cloc_version : 2.03
6-
elapsed_seconds : 0.00477790832519531
6+
elapsed_seconds : 0.00392413139343262
77
n_files : 1
88
n_lines : 37
9-
files_per_second : 209.296606786427
10-
lines_per_second : 7743.9744510978
9+
files_per_second : 254.833464973571
10+
lines_per_second : 9428.83820402211
1111
report_file : tests/outputs/parser_2.civet.yaml
1212
'Civet' :
1313
nFiles: 1
1414
blank: 4
15-
comment: 14
16-
code: 19
15+
comment: 10
16+
code: 23
1717
SUM:
1818
blank: 4
19-
comment: 14
20-
code: 19
19+
comment: 10
20+
code: 23
2121
nFiles: 1

0 commit comments

Comments
 (0)