Fix a regression on #1515. New tests.

This commit is contained in:
jdf
2010-03-18 15:09:06 +00:00
parent b847131581
commit 2712947178
6 changed files with 78 additions and 1 deletions
+4 -1
View File
@@ -62,7 +62,10 @@ pdeProgram
// selected in the previous alternative. static mode programs
// don't have member functions.
//
| ( ( options {greedy=false;}: possiblyEmptyField)* builtInType IDENT LPAREN )
// The typeSpec match causes ANTLR to emit a warning about potentially
// exiting the nongreedy match incorrectly, but I haven't found a case
// of that in practice. Please report such a case!
| ( (options{greedy=false;}: possiblyEmptyField)* typeSpec[false] IDENT LPAREN )
=> activeProgram
{ pp.setProgramType(PdePreprocessor.ProgramType.ACTIVE); }
+26
View File
@@ -0,0 +1,26 @@
import processing.core.*;
import processing.xml.*;
import java.applet.*;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.MouseEvent;
import java.awt.event.KeyEvent;
import java.awt.event.FocusEvent;
import java.awt.Image;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.zip.*;
import java.util.regex.*;
public class bug1512 extends PApplet {
public void setup() {
println("oi/*");
noLoop();
}
static public void main(String args[]) {
PApplet.main(new String[] { "--bgcolor=null", "bug1512" });
}
}
+1
View File
@@ -0,0 +1 @@
println("oi/*");
+30
View File
@@ -0,0 +1,30 @@
import processing.core.*;
import processing.xml.*;
import java.applet.*;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.MouseEvent;
import java.awt.event.KeyEvent;
import java.awt.event.FocusEvent;
import java.awt.Image;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.zip.*;
import java.util.regex.*;
public class bug1515 extends PApplet {
// a class definition that does something with things that extend PApplet
class Heythere<T extends PApplet>{
}
// method definition which can do things with papplet
public <T extends PApplet> void doSomething( T thing ){
}
static public void main(String args[]) {
PApplet.main(new String[] { "--bgcolor=null", "bug1515" });
}
}
+7
View File
@@ -0,0 +1,7 @@
// a class definition that does something with things that extend PApplet
class Heythere<T extends PApplet>{
}
// method definition which can do things with papplet
public <T extends PApplet> void doSomething( T thing ){
}
@@ -255,6 +255,11 @@ public class ParserTests {
expectGood("bug1511");
}
@Test
public void bug1512() {
expectGood("bug1512");
}
@Test
public void bug1514a() {
expectGood("bug1514a");
@@ -265,6 +270,11 @@ public class ParserTests {
expectGood("bug1514b");
}
@Test
public void bug1515() {
expectGood("bug1515");
}
@Test
public void bug1516() {
expectGood("bug1516");