Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ Carbon (carbon)
CCS (ccs)
Chapel (chpl)
Circom (circom)
Civet (civet, cvt, cvtx)
Clarity (clar)
Clean (dcl, icl)
Clojure (boot, cl2, clj, cljs.hl, cljscm, cljx, hic, riemann.config)
ClojureC (cljc)
Expand Down
5 changes: 5 additions & 0 deletions Unix/t/00_C.t
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,11 @@ my @Tests = (
'ref' => '../tests/outputs/scheme.sls.yaml',
'args' => '../tests/inputs/scheme.sls',
},
{
'name' => 'Clarity',
'ref' => '../tests/outputs/clarityfiles.clar.yaml',
'args' => '../tests/inputs/clarityfiles.clar',
},
{
'name' => 'SKILL',
'ref' => '../tests/outputs/ChangeProperties.il.yaml',
Expand Down
6 changes: 6 additions & 0 deletions cloc
Original file line number Diff line number Diff line change
Expand Up @@ -9414,6 +9414,7 @@ sub set_constants { # {{{1
'rhtml' => 'Ruby HTML' ,
'circom' => 'Circom' ,
'cairo' => 'Cairo' ,
'clar' => 'Clarity' ,
'rs.in' => 'Rust' ,
'rs' => 'Rust' ,
'rst.txt' => 'reStructuredText' ,
Expand Down Expand Up @@ -11157,6 +11158,10 @@ sub set_constants { # {{{1
[ 'remove_matches' , '^\s*#' ],
[ 'call_regexp_common' , 'C++' ],
],
'Clarity' => [
[ 'remove_matches' , '^\s*;;' ],
[ 'remove_inline' , ';;.*$' ],
],
'Rust' => [
[ 'rm_comments_in_strings', '"', '/*', '*/' ],
[ 'rm_comments_in_strings', '"', '//', '' ],
Expand Down Expand Up @@ -12165,6 +12170,7 @@ sub set_constants { # {{{1
'RobotFramework' => 2.50,
'Circom' => 1.00,
'Cairo' => 1.00,
'Clarity' => 1.47,
'Rust' => 1.00,
'sas' => 1.95,
'Scala' => 4.10,
Expand Down
31 changes: 31 additions & 0 deletions tests/inputs/clarityfiles.clar
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
;; Test fixture for Clarity language
;; This file covers various comment and code patterns

(define-constant TEST_CONSTANT u100)

;; Full line comment before code
(define-read-only (test-function (param uint))
(ok param)
)

;; Another comment
(define-map test-map
uint
bool
)

(define-public (public-function)
;; Inline comment in function
(begin
;; Nested comment
(ok true)
)
)

;; Trailing comment on code line
(define-data-var counter uint u0) ;; end of line comment

;; Multiple blank lines above

(define-constant ANOTHER_CONSTANT u200)

20 changes: 20 additions & 0 deletions tests/outputs/clarityfiles.clar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# github.com/AlDanial/cloc
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.07
elapsed_seconds : 0.00625514984130859
n_files : 1
n_lines : 31
files_per_second : 159.868272602531
lines_per_second : 4955.91645067846
'Clarity' :
nFiles: 1
blank: 8
comment: 8
code: 15
SUM:
blank: 8
comment: 8
code: 15
nFiles: 1