diff --git a/Unix/cloc b/Unix/cloc index a96f9650..41dd0942 100755 --- a/Unix/cloc +++ b/Unix/cloc @@ -8512,7 +8512,8 @@ sub set_constants { # {{{1 'inc' => 'PHP/Pascal/Fortran' , 'ino' => 'Arduino Sketch' , 'ipf' => 'Igor Pro' , - 'pde' => 'Arduino Sketch' , # pre 1.0 + #'pde' => 'Arduino Sketch' , # pre 1.0 + 'pde' => 'Processing' , # pre 1.0 'itk' => 'Tcl/Tk' , 'java' => 'Java' , 'jcl' => 'JCL' , # IBM Job Control Lang. @@ -10203,6 +10204,11 @@ sub set_constants { # {{{1 'Prisma Schema' => [ [ 'remove_matches' , '^\s*//' ], ], + 'Processing' => [ + [ 'rm_comments_in_strings', '"', '/*', '*/' ], + [ 'rm_comments_in_strings', '"', '//', '' ], + [ 'call_regexp_common' , 'C++' ], + ], 'ProGuard' => [ [ 'remove_matches' , '^\s*#' ], [ 'remove_inline' , '#.*$' ], @@ -11291,6 +11297,7 @@ sub set_constants { # {{{1 'PowerBuilder' => 3.33, 'PowerShell' => 3.00, 'Prisma Schema' => 2.50, + 'Processing' => 2.50, 'ProGuard' => 2.50, 'Prolog' => 1.25, 'Properties' => 1.36, diff --git a/Unix/t/00_C.t b/Unix/t/00_C.t index 01c0fa90..2f33fafc 100755 --- a/Unix/t/00_C.t +++ b/Unix/t/00_C.t @@ -896,6 +896,11 @@ my @Tests = ( 'ref' => '../tests/outputs/schema.prisma.yaml', 'args' => '../tests/inputs/schema.prisma', }, + { + 'name' => 'Processing', + 'ref' => '../tests/outputs/pointillism.pde.yaml', + 'args' => '../tests/inputs/pointillism.pde', + }, { 'name' => 'ProGuard', 'ref' => '../tests/outputs/proguard-project-app.pro.yaml', diff --git a/cloc b/cloc index 489006f5..240584a5 100755 --- a/cloc +++ b/cloc @@ -8527,7 +8527,8 @@ sub set_constants { # {{{1 'inc' => 'PHP/Pascal/Fortran' , 'ino' => 'Arduino Sketch' , 'ipf' => 'Igor Pro' , - 'pde' => 'Arduino Sketch' , # pre 1.0 + #'pde' => 'Arduino Sketch' , # pre 1.0 + 'pde' => 'Processing' , # pre 1.0 'itk' => 'Tcl/Tk' , 'java' => 'Java' , 'jcl' => 'JCL' , # IBM Job Control Lang. @@ -10218,6 +10219,11 @@ sub set_constants { # {{{1 'Prisma Schema' => [ [ 'remove_matches' , '^\s*//' ], ], + 'Processing' => [ + [ 'rm_comments_in_strings', '"', '/*', '*/' ], + [ 'rm_comments_in_strings', '"', '//', '' ], + [ 'call_regexp_common' , 'C++' ], + ], 'ProGuard' => [ [ 'remove_matches' , '^\s*#' ], [ 'remove_inline' , '#.*$' ], @@ -11306,6 +11312,7 @@ sub set_constants { # {{{1 'PowerBuilder' => 3.33, 'PowerShell' => 3.00, 'Prisma Schema' => 2.50, + 'Processing' => 2.50, 'ProGuard' => 2.50, 'Prolog' => 1.25, 'Properties' => 1.36, diff --git a/tests/inputs/pointillism.pde b/tests/inputs/pointillism.pde new file mode 100644 index 00000000..5819ab68 --- /dev/null +++ b/tests/inputs/pointillism.pde @@ -0,0 +1,32 @@ +/** + * Pointillism + * by Daniel Shiffman. + * + * Mouse horizontal location controls size of dots. + * Creates a simple pointillist effect using ellipses colored + * according to pixels in an image. + */ + +PImage img; +int smallPoint, largePoint; + +void setup() { + size(640, 360); + img = loadImage("moonwalk.jpg"); + smallPoint = 4; + largePoint = 40; + imageMode(CENTER); + noStroke(); + background(255); +} + +void draw() { + float pointillize = map(mouseX, 0, width, smallPoint, largePoint); + int x = int(random(img.width)); + int y = int(random(img.height)); + color pix = img.get(x, y); + fill(pix, 128); + ellipse(x, y, pointillize, pointillize); +} + +// https://processing.org/examples/pointillism.html diff --git a/tests/outputs/pointillism.pde.yaml b/tests/outputs/pointillism.pde.yaml new file mode 100644 index 00000000..7e60928c --- /dev/null +++ b/tests/outputs/pointillism.pde.yaml @@ -0,0 +1,21 @@ +--- +# github.com/AlDanial/cloc +header : + cloc_url : github.com/AlDanial/cloc + cloc_version : 2.01 + elapsed_seconds : 0.00258994102478027 + n_files : 1 + n_lines : 32 + files_per_second : 386.109177943478 + lines_per_second : 12355.4936941913 + report_file : ../outputs/pointillism.pde.yaml +'Processing' : + nFiles: 1 + blank: 4 + comment: 9 + code: 19 +SUM: + blank: 4 + comment: 9 + code: 19 + nFiles: 1