Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ warnMixedModes

variableDeclaratorId
: warnTypeAsVariableName
| IDENTIFIER ('[' ']')*
| identifier ('[' ']')*
;

// bug #93
Expand All @@ -68,7 +68,7 @@ warnTypeAsVariableName
// catch special API function calls that we are interested in
methodCall
: functionWithPrimitiveTypeName
| IDENTIFIER '(' expressionList? ')'
| identifier '(' expressionList? ')'
| THIS '(' expressionList? ')'
| SUPER '(' expressionList? ')'
;
Expand Down Expand Up @@ -103,7 +103,7 @@ colorPrimitiveType
;

qualifiedName
: (IDENTIFIER | colorPrimitiveType) ('.' (IDENTIFIER | colorPrimitiveType))*
: (identifier | colorPrimitiveType) ('.' (identifier | colorPrimitiveType))*
;

// added HexColorLiteral
Expand Down
5 changes: 5 additions & 0 deletions java/test/processing/mode/java/ParserTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ public void bug1532() {
expectRecognitionException("bug1532", 43);
}

@Test
public void bug1501() {
expectGood("bug1501");
}

@Test
public void bug1534() {
expectGood("bug1534");
Expand Down
51 changes: 51 additions & 0 deletions java/test/resources/bug1501.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;

import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;

public class bug1501 extends PApplet {

float to;
Module module;

public void setup() {
/* size commented out by preprocessor */;
int open = 1;
String with = "with";
to = 5.0f;
module = new Module();
int transitive = open + 2;
println(to, with, transitive);
provides();
}

public void provides() {
int record = 2;
int permits = record + 1;
println(permits);
}

class Module {
}


public void settings() { size(400, 400); }

static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1501" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
22 changes: 22 additions & 0 deletions java/test/resources/bug1501.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
float to;
Module module;

void setup() {
size(400, 400);
int open = 1;
String with = "with";
to = 5.0;
module = new Module();
int transitive = open + 2;
println(to, with, transitive);
provides();
}

void provides() {
int record = 2;
int permits = record + 1;
println(permits);
}

class Module {
}
Loading