File tree Expand file tree Collapse file tree 4 files changed +63
-1
lines changed
src/processing/mode/java/preproc Expand file tree Collapse file tree 4 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -542,7 +542,7 @@ public void exitFunctionWithPrimitiveTypeName(
542542 */
543543 public void exitColorPrimitiveType (ProcessingParser .ColorPrimitiveTypeContext ctx ) {
544544 if (ctx .getText ().equals ("color" )) {
545- insertBefore (ctx .start , "int" );
545+ insertAfter (ctx .stop , "int" );
546546 delete (ctx .start , ctx .stop );
547547 }
548548 }
Original file line number Diff line number Diff line change @@ -360,4 +360,9 @@ public void testPdfWrite() {
360360 expectGood ("pdfwrite" );
361361 }
362362
363+ @ Test
364+ public void testColorReturn () {
365+ expectGood ("colorreturn" );
366+ }
367+
363368}
Original file line number Diff line number Diff line change 1+ import processing.core.*;
2+ import processing.data.*;
3+ import processing.event.*;
4+ import processing.opengl.*;
5+
6+ import java.util.HashMap;
7+ import java.util.ArrayList;
8+ import java.io.File;
9+ import java.io.BufferedReader;
10+ import java.io.PrintWriter;
11+ import java.io.InputStream;
12+ import java.io.OutputStream;
13+ import java.io.IOException;
14+
15+ public class colorreturn extends PApplet {
16+
17+ public void setup() {
18+ fill(getColor());
19+ noStroke();
20+ /* size commented out by preprocessor */;
21+ ellipseMode(CENTER);
22+ ellipse(50, 50, 50, 50);
23+ }
24+
25+ public int getColor() {
26+ return 0xFF333333;
27+ }
28+
29+ public void draw() {
30+ }
31+
32+
33+ public void settings() { size(100,100); }
34+
35+ static public void main(String[] passedArgs) {
36+ String[] appletArgs = new String[] { "colorreturn" };
37+ if (passedArgs != null) {
38+ PApplet.main(concat(appletArgs, passedArgs));
39+ } else {
40+ PApplet.main(appletArgs);
41+ }
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ public void setup () {
2+ fill (getColor());
3+ noStroke ();
4+ size (100 , 100 );
5+ ellipseMode (CENTER );
6+ ellipse (50 , 50 , 50 , 50 );
7+ }
8+
9+ color getColor () {
10+ return #333333 ;
11+ }
12+
13+ public void draw () {
14+ }
You can’t perform that action at this time.
0 commit comments