minor cleanups, some notes, see if better option for issue #1312

This commit is contained in:
benfry
2012-10-19 16:10:04 +00:00
parent ab815ede89
commit 32dd29962c
4 changed files with 27 additions and 24 deletions

View File

@@ -59,8 +59,8 @@ public class Compiler {
String baseCommand[] = new String[] {
"-Xemacs",
//"-noExit", // not necessary for ecj
"-source", "1.5",
"-target", "1.5",
"-source", "1.6",
"-target", "1.6",
"-classpath", build.getClassPath(),
"-nowarn", // we're not currently interested in warnings (works in ecj)
"-d", build.getBinFolder().getAbsolutePath() // output the classes in the buildPath

View File

@@ -275,6 +275,7 @@ public class JavaBuild {
fnfe.printStackTrace();
String msg = "Build folder disappeared or could not be written";
throw new SketchException(msg);
} catch (antlr.RecognitionException re) {
// re also returns a column that we're not bothering with for now
// first assume that it's the main file
@@ -293,7 +294,7 @@ public class JavaBuild {
String msg = re.getMessage();
//System.out.println(java.getAbsolutePath());
System.out.println(bigCode);
// System.out.println(bigCode);
if (msg.contains("expecting RCURLY")) {
//if (msg.equals("expecting RCURLY, found 'null'")) {

View File

@@ -169,6 +169,20 @@ public class PdePreprocessor {
"(?:^|\\s|;)size\\s*\\(\\s*([^\\s,]+)\\s*,\\s*([^\\s,\\)]+),?\\s*([^\\)]*)\\s*\\)\\s*\\;";
//"(?:^|\\s|;)size\\s*\\(\\s*(\\S+)\\s*,\\s*([^\\s,\\)]+),?\\s*([^\\)]*)\\s*\\)\\s*\\;";
private static final Pattern PUBLIC_CLASS =
Pattern.compile("(^|;)\\s*public\\s+class\\s+\\S+\\s+extends\\s+PApplet", Pattern.MULTILINE);
// Can't only match any 'public class', needs to be a PApplet
// http://code.google.com/p/processing/issues/detail?id=551
//Pattern.compile("(^|;)\\s*public\\s+class", Pattern.MULTILINE);
private static final Pattern FUNCTION_DECL =
Pattern.compile("(^|;)\\s*((public|private|protected|final|static)\\s+)*" +
"(void|int|float|double|String|char|byte)" +
"(\\s*\\[\\s*\\])?\\s+[a-zA-Z0-9]+\\s*\\(",
Pattern.MULTILINE);
public PdePreprocessor(final String sketchName) {
this(sketchName, Preferences.getInteger("editor.tabs.size"));
@@ -340,7 +354,7 @@ public class PdePreprocessor {
public void setMode(final Mode mode) {
// System.err.println("Setting mode to " + mode);
//System.err.println("Setting mode to " + mode);
this.mode = mode;
}
@@ -565,17 +579,6 @@ public class PdePreprocessor {
return new String(p2, 0, index);
}
private static final Pattern PUBLIC_CLASS =
Pattern.compile("(^|;)\\s*public\\s+class\\s+\\S+\\s+extends\\s+PApplet", Pattern.MULTILINE);
// Can't only match any 'public class', needs to be a PApplet
// http://code.google.com/p/processing/issues/detail?id=551
//Pattern.compile("(^|;)\\s*public\\s+class", Pattern.MULTILINE);
private static final Pattern FUNCTION_DECL =
Pattern.compile("(^|;)\\s*((public|private|protected|final|static)\\s+)*" +
"(void|int|float|double|String|char|byte)" +
"(\\s*\\[\\s*\\])?\\s+[a-zA-Z0-9]+\\s*\\(",
Pattern.MULTILINE);
/**
* preprocesses a pde file and writes out a java file