diff --git a/app/test/resources/bug507.pde b/app/test/resources/bug507.pde new file mode 100644 index 000000000..b74278141 --- /dev/null +++ b/app/test/resources/bug507.pde @@ -0,0 +1,8 @@ +void setup() { +if (1 == 2) { +println("the impossible just happened"); +} +} else { +println("zzz"); +} +} \ No newline at end of file diff --git a/app/test/resources/bug6.pde b/app/test/resources/bug6.pde new file mode 100644 index 000000000..3f92ffbea --- /dev/null +++ b/app/test/resources/bug6.pde @@ -0,0 +1 @@ +println("hello");/println("world"); \ No newline at end of file diff --git a/app/test/resources/bug631.expected b/app/test/resources/bug631.expected new file mode 100644 index 000000000..37a196c45 --- /dev/null +++ b/app/test/resources/bug631.expected @@ -0,0 +1,32 @@ +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 bug631 extends PApplet { + public void setup() { +firstLoop: + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + if ((i+j) % 5 != 0) continue firstLoop; + System.out.println(i + " " + j); + } + } + noLoop(); +} + static public void main(String args[]) { + PApplet.main(new String[] { "--bgcolor=null", "bug631" }); + } +} diff --git a/app/test/resources/bug631.pde b/app/test/resources/bug631.pde new file mode 100644 index 000000000..e51bf87a1 --- /dev/null +++ b/app/test/resources/bug631.pde @@ -0,0 +1,7 @@ +firstLoop: + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + if ((i+j) % 5 != 0) continue firstLoop; + System.out.println(i + " " + j); + } + } \ No newline at end of file diff --git a/app/test/src/test/processing/parsing/ParserTests.java b/app/test/src/test/processing/parsing/ParserTests.java index 9791b08c1..96d1b8213 100644 --- a/app/test/src/test/processing/parsing/ParserTests.java +++ b/app/test/src/test/processing/parsing/ParserTests.java @@ -147,6 +147,11 @@ public class ParserTests { expectGood("bug5b"); } + @Test + public void bug6() { + expectRecognitionException("bug6", "expecting EOF, found '/'", 1); + } + @Test public void bug16() { expectRunnerException("bug16", "Unclosed /* comment */", 2); @@ -173,6 +178,16 @@ public class ParserTests { expectGood("bug481"); } + @Test + public void bug507() { + expectRecognitionException("bug507", "expecting EOF, found 'else'", 5); + } + + @Test + public void bug631() { + expectGood("bug631"); + } + @Test public void bug1511() { expectGood("bug1511");