diff --git a/README.md b/README.md index 29c4212b..d7a71859 100644 --- a/README.md +++ b/README.md @@ -1283,6 +1283,7 @@ Python (buck, build.bazel, gclient, gyp, gypi, lmi, py, py3, pyt, pyw, sconscript, sconstruct, snakefile, tac, workspace, wscript, wsgi, xpy) QML (qbs, qml) +Quxlang (qxs) Qt Linguist (ts) Qt Project (pro) R (expr-dist, R, r, rd, rprofile, rsx) diff --git a/Unix/t/00_C.t b/Unix/t/00_C.t index faa1591c..755aae28 100755 --- a/Unix/t/00_C.t +++ b/Unix/t/00_C.t @@ -1166,6 +1166,11 @@ my @Tests = ( 'ref' => '../tests/outputs/test-1.0-py2.py3-none-win32.whl.yaml', 'args' => '../tests/inputs/test-1.0-py2.py3-none-win32.whl', }, + { + 'name' => 'Quxlang', + 'ref' => '../tests/outputs/sample.qxs.yaml', + 'args' => '../tests/inputs/sample.qxs', + }, { 'name' => 'Qt Linguist', 'ref' => '../tests/outputs/i18n_de.ts.yaml', diff --git a/cloc b/cloc index 43e74136..28766324 100755 --- a/cloc +++ b/cloc @@ -9432,6 +9432,7 @@ sub set_constants { # {{{1 'pyx' => 'Cython' , 'qbs' => 'QML' , 'qml' => 'QML' , + 'qxs' => 'Quxlang' , 'watchr' => 'Ruby' , 'vagrantfile' => 'Ruby' , 'thorfile' => 'Ruby' , @@ -11195,6 +11196,13 @@ sub set_constants { # {{{1 [ 'remove_matches' , '^\s*#' ], [ 'remove_inline' , '#.*$' ], ], + 'Quxlang' => [ + [ 'remove_between_regex', '\bDOC\s*<\$', '\$>' ], + [ 'rm_comments_in_strings', '"', '//', '' ], + [ 'rm_comments_in_strings', "'", '//', '' ], + [ 'remove_matches' , '^\s*//' ], + [ 'remove_inline' , '//.*$' ], + ], 'R' => [ [ 'remove_matches' , '^\s*#' ], [ 'remove_inline' , '#.*$' ], @@ -12294,6 +12302,7 @@ sub set_constants { # {{{1 'XML (Qt/GTK)' => 2.00, 'Qt Linguist' => 1.00, 'Qt Project' => 1.00, + 'Quxlang' => 1.75, 'R' => 3.00, 'Rmd' => 3.00, 'Racket' => 1.50, diff --git a/tests/inputs/sample.qxs b/tests/inputs/sample.qxs new file mode 100644 index 00000000..bbad4233 --- /dev/null +++ b/tests/inputs/sample.qxs @@ -0,0 +1,23 @@ +// Quxlang source fixture. + +::url STATIC STRING_CONSTANT := "https://example.test//not-comment"; + +::documented DOC <$ + Summary line still doc text. + more text +$> STATIC STRING_CONSTANT := "documented"; +::multi_doc DOC <$ + bla bla + bla bla +$> STATIC STRING_CONSTANT := "multi"; +::inline_doc DOC <$ one line doc $> FUNCTION() +{ +} +::slash STATIC BYTE := '/'; // Inline comment after a char literal. +::main FUNCTION() +{ + VAR text STRING_CONSTANT := "value // not a comment"; + VAR slash BYTE := '/'; + // Body comment. + RETURN; +} diff --git a/tests/outputs/sample.qxs.yaml b/tests/outputs/sample.qxs.yaml new file mode 100644 index 00000000..d90ab539 --- /dev/null +++ b/tests/outputs/sample.qxs.yaml @@ -0,0 +1,21 @@ +--- +# github.com/AlDanial/cloc +header : + cloc_url : github.com/AlDanial/cloc + cloc_version : 2.09 + elapsed_seconds : 0.00587797164916992 + n_files : 1 + n_lines : 23 + files_per_second : 170.126713717855 + lines_per_second : 3912.91441551067 + report_file : sample.qxs.yaml +'Quxlang' : + nFiles: 1 + blank: 2 + comment: 6 + code: 15 +SUM: + blank: 2 + comment: 6 + code: 15 + nFiles: 1