mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Fix a regression on #1515. New tests.
This commit is contained in:
+4
-1
@@ -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); }
|
||||
|
||||
|
||||
@@ -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" });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
println("oi/*");
|
||||
@@ -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" });
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user