mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 21:59:20 +01:00
new preproc work for int() et al on arrays.. routes through PApplet
This commit is contained in:
@@ -59,11 +59,11 @@ public class PdePreprocessor {
|
||||
*/
|
||||
public PdePreprocessor() {
|
||||
defaultImports[JDK11] =
|
||||
PApplet.split(PdePreferences.get("compiler.imports.jdk11"), ',');
|
||||
PApplet.split(PdePreferences.get("preproc.imports.jdk11"), ',');
|
||||
defaultImports[JDK13] =
|
||||
PApplet.split(PdePreferences.get("compiler.imports.jdk13"), ',');
|
||||
PApplet.split(PdePreferences.get("preproc.imports.jdk13"), ',');
|
||||
defaultImports[JDK14] =
|
||||
PApplet.split(PdePreferences.get("compiler.imports.jdk14"), ',');
|
||||
PApplet.split(PdePreferences.get("preproc.imports.jdk14"), ',');
|
||||
}
|
||||
|
||||
|
||||
@@ -79,14 +79,13 @@ public class PdePreprocessor {
|
||||
*/
|
||||
public String write(String program, String buildPath, String name,
|
||||
String extraImports[]) throws java.lang.Exception {
|
||||
// if the program ends with a comment, and no CR or LF
|
||||
// an OutOfMemoryError will happen.. not gonna track down the
|
||||
// bug now, so here's a hack for it:
|
||||
if (program.endsWith("//")) {
|
||||
// if the program ends with no CR or LF an OutOfMemoryError will happen.
|
||||
// not gonna track down the bug now, so here's a hack for it:
|
||||
if (program.charAt(program.length()-1) != '\n') {
|
||||
program += "\n";
|
||||
}
|
||||
|
||||
if (PdePreferences.getBoolean("compiler.substitute_unicode")) {
|
||||
if (PdePreferences.getBoolean("preproc.substitute_unicode")) {
|
||||
// check for non-ascii chars (these will be/must be in unicode format)
|
||||
char p[] = program.toCharArray();
|
||||
int unicodeCount = 0;
|
||||
@@ -204,7 +203,7 @@ public class PdePreprocessor {
|
||||
// if desired, serialize the parse tree to an XML file. can
|
||||
// be viewed usefully with Mozilla or IE
|
||||
|
||||
if (PdePreferences.getBoolean("compiler.output_parse_tree")) {
|
||||
if (PdePreferences.getBoolean("preproc.output_parse_tree")) {
|
||||
|
||||
stream = new PrintStream(new FileOutputStream("parseTree.xml"));
|
||||
stream.println("<?xml version=\"1.0\"?>");
|
||||
@@ -244,7 +243,7 @@ public class PdePreprocessor {
|
||||
|
||||
// emit standard imports (read from pde.properties)
|
||||
// for each language level that's being used.
|
||||
String jdkVersionStr = PdePreferences.get("compiler.jdk_version");
|
||||
String jdkVersionStr = PdePreferences.get("preproc.jdk_version");
|
||||
|
||||
int jdkVersion = JDK11; // default
|
||||
if (jdkVersionStr.equals("1.3")) { jdkVersion = JDK13; };
|
||||
|
||||
Reference in New Issue
Block a user