diff --git a/Unix/cloc b/Unix/cloc index d153d916..57d24f74 100755 --- a/Unix/cloc +++ b/Unix/cloc @@ -8279,6 +8279,7 @@ sub set_constants { # {{{1 'ejs' => 'EJS' , 'erb' => 'ERB' , 'ERB' => 'ERB' , + 'ets' => 'ArkTs' , # OpenHarmonyOS app language 'yrl' => 'Erlang' , 'xrl' => 'Erlang' , 'rebar.lock' => 'Erlang' , @@ -9185,6 +9186,11 @@ sub set_constants { # {{{1 [ 'rm_comments_in_strings', '"', '//', '' ], [ 'call_regexp_common' , 'C++' ], ], + 'ArkTs' => [ + [ 'rm_comments_in_strings', '"', '/*', '*/' ], + [ 'rm_comments_in_strings', '"', '//', '' ], + [ 'call_regexp_common' , 'C++' ], + ], 'AsciiDoc' => [ [ 'remove_between_general', '////', '////' ], [ 'remove_matches' , '^\s*\/\/' ], @@ -10924,6 +10930,7 @@ sub set_constants { # {{{1 'SQL Data' => 1.00, 'Apex Class' => 1.50, 'APL' => 2.50, + 'ArkTs' => 2.50, 'AsciiDoc' => 1.50, 'AspectJ' => 1.36, 'asa' => 1.29, diff --git a/Unix/t/00_C.t b/Unix/t/00_C.t index 332dc1a2..9c2f298e 100755 --- a/Unix/t/00_C.t +++ b/Unix/t/00_C.t @@ -39,6 +39,11 @@ my @Tests = ( 'ref' => '../tests/outputs/send_msg.applescript.yaml', 'args' => '../tests/inputs/send_msg.applescript', }, + { + 'name' => 'ArkTs', + 'ref' => '../tests/outputs/openharmony.ets.yaml', + 'args' => '../tests/inputs/openharmony.ets', + }, { 'name' => 'AsciiDoc', 'ref' => '../tests/outputs/asciidoctor.adoc.yaml', diff --git a/cloc b/cloc index 219b447d..4547ad69 100755 --- a/cloc +++ b/cloc @@ -8294,6 +8294,7 @@ sub set_constants { # {{{1 'ejs' => 'EJS' , 'erb' => 'ERB' , 'ERB' => 'ERB' , + 'ets' => 'ArkTs' , # OpenHarmonyOS app language 'yrl' => 'Erlang' , 'xrl' => 'Erlang' , 'rebar.lock' => 'Erlang' , @@ -9200,6 +9201,11 @@ sub set_constants { # {{{1 [ 'rm_comments_in_strings', '"', '//', '' ], [ 'call_regexp_common' , 'C++' ], ], + 'ArkTs' => [ + [ 'rm_comments_in_strings', '"', '/*', '*/' ], + [ 'rm_comments_in_strings', '"', '//', '' ], + [ 'call_regexp_common' , 'C++' ], + ], 'AsciiDoc' => [ [ 'remove_between_general', '////', '////' ], [ 'remove_matches' , '^\s*\/\/' ], @@ -10939,6 +10945,7 @@ sub set_constants { # {{{1 'SQL Data' => 1.00, 'Apex Class' => 1.50, 'APL' => 2.50, + 'ArkTs' => 2.50, 'AsciiDoc' => 1.50, 'AspectJ' => 1.36, 'asa' => 1.29, diff --git a/tests/inputs/openharmony.ets b/tests/inputs/openharmony.ets new file mode 100644 index 00000000..2330bed8 --- /dev/null +++ b/tests/inputs/openharmony.ets @@ -0,0 +1,21 @@ +// https://github.com/openharmony/docs/blob/master/en/application-dev/quick-start/start-with-ets.md +// index.ets +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + build() { + Row() { +/* + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') +*/ + } + .height('100%') + } +} diff --git a/tests/outputs/openharmony.ets.yaml b/tests/outputs/openharmony.ets.yaml new file mode 100644 index 00000000..1d4e10cd --- /dev/null +++ b/tests/outputs/openharmony.ets.yaml @@ -0,0 +1,21 @@ +--- +# github.com/AlDanial/cloc +header : + cloc_url : github.com/AlDanial/cloc + cloc_version : 1.99 + elapsed_seconds : 0.00846600532531738 + n_files : 1 + n_lines : 21 + files_per_second : 118.119462671435 + lines_per_second : 2480.50871610014 + report_file : ../outputs/openharmony.ets.yaml +'ArkTs' : + nFiles: 1 + blank: 1 + comment: 10 + code: 10 +SUM: + blank: 1 + comment: 10 + code: 10 + nFiles: 1