diff --git a/README.md b/README.md index 5ad1732..62cc7ae 100644 --- a/README.md +++ b/README.md @@ -797,7 +797,7 @@ builder (xml.builder) C (c, ec, pgc) C Shell (csh, tcsh) C# (cs) -C++ (C, c++, cc, cpp, cxx, pcc) +C++ (C, c++, cc, cpp, CPP, cxx, pcc) C/C++ Header (h, H, hh, hpp, hxx) CCS (ccs) Clean (dcl, icl) diff --git a/Unix/cloc b/Unix/cloc index d17ecc3..bceda3f 100755 --- a/Unix/cloc +++ b/Unix/cloc @@ -5359,6 +5359,7 @@ sub set_constants { # {{{1 'coffee' => 'CoffeeScript' , 'component' => 'Visualforce Component' , 'cpp' => 'C++' , + 'CPP' => 'C++' , 'cr' => 'Crystal' , 'cs' => 'C#' , 'csh' => 'C Shell' , diff --git a/Unix/results.yaml b/Unix/results.yaml new file mode 100644 index 0000000..9c5f63d --- /dev/null +++ b/Unix/results.yaml @@ -0,0 +1,21 @@ +--- +# github.com/AlDanial/cloc +header : + cloc_url : github.com/AlDanial/cloc + cloc_version : 1.73 + elapsed_seconds : 0.00850009918212891 + n_files : 1 + n_lines : 8 + files_per_second : 117.645686076517 + lines_per_second : 941.16548861214 + report_file : results.yaml +XSLT : + nFiles: 1 + blank: 0 + comment: 2 + code: 6 +SUM: + blank: 0 + comment: 2 + code: 6 + nFiles: 1 diff --git a/Unix/t/00_C.t b/Unix/t/00_C.t index 85c46aa..55ddc2a 100755 --- a/Unix/t/00_C.t +++ b/Unix/t/00_C.t @@ -79,6 +79,11 @@ my @Tests = ( { 'args' => '../tests/inputs/C++-MFC.cc', }, { + 'name' => 'C++ Uppercase extension', + 'ref' => '../tests/outputs/C++-uppercase.CPP.yaml', + 'args' => '../tests/inputs/C++-uppercase.CPP', + }, + { 'name' => 'C simple', 'ref' => '../tests/outputs/C-Ansi.c.yaml', 'args' => '../tests/inputs/C-Ansi.c', diff --git a/cloc b/cloc index 070a551..9db3699 100755 --- a/cloc +++ b/cloc @@ -5392,6 +5392,7 @@ sub set_constants { # {{{1 'coffee' => 'CoffeeScript' , 'component' => 'Visualforce Component' , 'cpp' => 'C++' , + 'CPP' => 'C++' , 'cr' => 'Crystal' , 'cs' => 'C#/Smalltalk' , 'csh' => 'C Shell' , diff --git a/tests/inputs/C++-uppercase.CPP b/tests/inputs/C++-uppercase.CPP new file mode 100644 index 0000000..bb6f548 --- /dev/null +++ b/tests/inputs/C++-uppercase.CPP @@ -0,0 +1,4 @@ +// Comment + +int main() {} + diff --git a/tests/outputs/C++-uppercase.CPP.yaml b/tests/outputs/C++-uppercase.CPP.yaml new file mode 100644 index 0000000..3c76164 --- /dev/null +++ b/tests/outputs/C++-uppercase.CPP.yaml @@ -0,0 +1,21 @@ +--- +# github.com/AlDanial/cloc +header : + cloc_url : github.com/AlDanial/cloc + cloc_version : 1.67 + elapsed_seconds : 0.00526905059814453 + n_files : 1 + n_lines : 1 + files_per_second : 189.787511312217 + lines_per_second : 5693.62533936652 + report_file : C++-uppercase.CPP.yaml +C++ : + nFiles: 1 + blank: 2 + comment: 1 + code: 1 +SUM: + blank: 2 + comment: 1 + code: 1 + nFiles: 1