Skip to content

Commit 5e2420b

Browse files
committed
add support for Yarn, #927
1 parent dfaa461 commit 5e2420b

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed

Unix/cloc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9749,6 +9749,7 @@ sub set_constants { # {{{1
97499749
'yaml' => 'YAML' ,
97509750
'yml' => 'YAML' ,
97519751
'yang' => 'Yang' ,
9752+
'yarn' => 'Yarn' ,
97529753
'zig' => 'Zig' ,
97539754
'zsh' => 'zsh' ,
97549755
'rego' => 'Rego' ,
@@ -11635,6 +11636,9 @@ sub set_constants { # {{{1
1163511636
[ 'rm_comments_in_strings', '"', '//', '' ],
1163611637
[ 'call_regexp_common' , 'C++' ],
1163711638
],
11639+
'Yarn' => [
11640+
[ 'remove_matches' , '^\s*//' ],
11641+
],
1163811642
'Zig' => [
1163911643
[ 'remove_matches' , '^\s*//' ],
1164011644
[ 'remove_inline' , '//.*$' ],
@@ -12212,6 +12216,7 @@ sub set_constants { # {{{1
1221212216
'yacc' => 1.51,
1221312217
'yacc++' => 1.51,
1221412218
'YAML' => 0.90,
12219+
'Yarn' => 2.00,
1221512220
'Expect' => 2.00,
1221612221
'Gencat NLS' => 1.50,
1221712222
'C/C++ Header' => 1.00,

Unix/t/00_C.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,11 @@ my @Tests = (
15411541
'ref' => '../tests/outputs/bbf-device.yang.yaml',
15421542
'args' => '../tests/inputs/bbf-device.yang',
15431543
},
1544+
{
1545+
'name' => 'Yarn',
1546+
'ref' => '../tests/outputs/guard_talking.yarn.yaml',
1547+
'args' => '../tests/inputs/guard_talking.yarn',
1548+
},
15441549
{
15451550
'name' => 'Zig',
15461551
'ref' => '../tests/outputs/zir_sema.zig.yaml',

cloc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9741,6 +9741,7 @@ sub set_constants { # {{{1
97419741
'yaml' => 'YAML' ,
97429742
'yml' => 'YAML' ,
97439743
'yang' => 'Yang' ,
9744+
'yarn' => 'Yarn' ,
97449745
'zig' => 'Zig' ,
97459746
'zsh' => 'zsh' ,
97469747
'rego' => 'Rego' ,
@@ -11627,6 +11628,9 @@ sub set_constants { # {{{1
1162711628
[ 'rm_comments_in_strings', '"', '//', '' ],
1162811629
[ 'call_regexp_common' , 'C++' ],
1162911630
],
11631+
'Yarn' => [
11632+
[ 'remove_matches' , '^\s*//' ],
11633+
],
1163011634
'Zig' => [
1163111635
[ 'remove_matches' , '^\s*//' ],
1163211636
[ 'remove_inline' , '//.*$' ],
@@ -12204,6 +12208,7 @@ sub set_constants { # {{{1
1220412208
'yacc' => 1.51,
1220512209
'yacc++' => 1.51,
1220612210
'YAML' => 0.90,
12211+
'Yarn' => 2.00,
1220712212
'Expect' => 2.00,
1220812213
'Gencat NLS' => 1.50,
1220912214
'C/C++ Header' => 1.00,

tests/inputs/guard_talking.yarn

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// https://docs.yarnspinner.dev/write-yarn-scripts/scripting-fundamentals/detour
2+
title: Guard
3+
---
4+
Guard: Have I told you my backstory?
5+
-> Yes.
6+
Guard: Oh. Well, then.
7+
-> No?
8+
<<detour Guard_Backstory>>
9+
Guard: Anyway, you can't come in.
10+
===
11+
12+
title: Guard_Backstory
13+
---
14+
Guard: Do you want the detailed version or the short version?
15+
-> Detailed.
16+
<<detour Guard_Detailed_Backstory>>
17+
Guard: I hope you enjoyed learning all that.. Anyway...
18+
-> Short.
19+
Guard: Right, well, I was a recruit, then I wasn't.
20+
===
21+
22+
title: Guard_Detailed_Backstory
23+
---
24+
Guard: It all started when I was a mere recruit.
25+
// (five minutes of exposition omitted)
26+
// (other stuff happens)
27+
Guard: Want to hear more?
28+
-> Yes.
29+
-> No.
30+
<<return>>
31+
Guard: (speaks more garbage)
32+
===
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# github.com/AlDanial/cloc
3+
header :
4+
cloc_url : github.com/AlDanial/cloc
5+
cloc_version : 2.07
6+
elapsed_seconds : 0.00369501113891602
7+
n_files : 1
8+
n_lines : 32
9+
files_per_second : 270.63517873274
10+
lines_per_second : 8660.32571944767
11+
report_file : ../outputs/guard_talking.yarn.yaml
12+
'Yarn' :
13+
nFiles: 1
14+
blank: 2
15+
comment: 3
16+
code: 27
17+
SUM:
18+
blank: 2
19+
comment: 3
20+
code: 27
21+
nFiles: 1

0 commit comments

Comments
 (0)