mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Fix 1534
This commit is contained in:
@@ -262,7 +262,26 @@ public class PdePreprocessor implements PdeTokenTypes {
|
||||
countNewlines(program.substring(0,
|
||||
stringStart)));
|
||||
}
|
||||
} else if (program.charAt(i) == '\'') {
|
||||
i++;
|
||||
if (i >= length) {
|
||||
throw new RunnerException("Unterminated character constant", 0,
|
||||
countNewlines(program.substring(0, i)));
|
||||
}
|
||||
if (program.charAt(i) == '\\') {
|
||||
i++;
|
||||
}
|
||||
i++;
|
||||
if (i >= length) {
|
||||
throw new RunnerException("Unterminated character constant", 0,
|
||||
countNewlines(program.substring(0, i)));
|
||||
}
|
||||
if (program.charAt(i) != '\'') {
|
||||
throw new RunnerException("Badly formed character constant", 0,
|
||||
countNewlines(program.substring(0, i)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,8 +617,7 @@ public class PdePreprocessor implements PdeTokenTypes {
|
||||
out.println("} ");
|
||||
}
|
||||
|
||||
if ((mode == Mode.STATIC)
|
||||
|| (mode == Mode.ACTIVE)) {
|
||||
if ((mode == Mode.STATIC) || (mode == Mode.ACTIVE)) {
|
||||
if (!foundMain) {
|
||||
out.println(indent + "static public void main(String args[]) {");
|
||||
out.print(indent + indent + "PApplet.main(new String[] { ");
|
||||
|
||||
@@ -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 bug1534 extends PApplet {
|
||||
public void setup() {
|
||||
char c = '\"';
|
||||
noLoop();
|
||||
}
|
||||
static public void main(String args[]) {
|
||||
PApplet.main(new String[] { "--bgcolor=null", "bug1534" });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
char c = '\"';
|
||||
@@ -16,7 +16,7 @@ import static test.processing.parsing.ProcessingTestUtil.COMPILER;
|
||||
import static test.processing.parsing.ProcessingTestUtil.preprocess;
|
||||
|
||||
public class ParserTests {
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
ProcessingTestUtil.init();
|
||||
@@ -259,4 +259,9 @@ public class ParserTests {
|
||||
public void bug1525() {
|
||||
expectGood("bug1525");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bug1534() {
|
||||
expectGood("bug1534");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user