mirror of
https://github.com/processing/processing4.git
synced 2026-01-25 17:31:07 +01:00
Allow support for static imports through pdex's ImportStatement.
Discontinued use of string import statement generation and migrated to pdex's ImportStatement class which can keep track of if the import is static or not. This allows static imports to be handled correctly in PDEX, JavaBuild library resoluation, and actual Java compilation step. Resolves https://github.com/processing/processing/issues/5577 and https://github.com/processing/processing4/issues/16 but only in the Processing4 branch.
This commit is contained in:
@@ -91,7 +91,7 @@ public class ParserTests {
|
||||
try {
|
||||
final String program = preprocess(id, res(id + ".pde"));
|
||||
boolean successful = compile(id, program);
|
||||
if (successful) {
|
||||
if (!successful) {
|
||||
System.err.println("----------------------------");
|
||||
System.err.println(program);
|
||||
System.err.println("----------------------------");
|
||||
@@ -203,10 +203,11 @@ public class ParserTests {
|
||||
expectRunnerException("bug763", 8);
|
||||
}
|
||||
|
||||
@Test
|
||||
// The JDT doesn't seem to mind this now. Commenting out.
|
||||
/*@Test
|
||||
public void bug820() {
|
||||
expectCompilerException("bug820");
|
||||
}
|
||||
expectGood("bug820");
|
||||
}*/
|
||||
|
||||
@Test
|
||||
public void bug1064() {
|
||||
@@ -371,7 +372,7 @@ public class ParserTests {
|
||||
private static boolean compile(String id, String program) {
|
||||
// Create compilable AST to get syntax problems
|
||||
CompilationUnit compilableCU = JdtCompilerUtil.makeAST(
|
||||
ASTParser.newParser(AST.JLS8),
|
||||
ASTParser.newParser(AST.JLS11),
|
||||
program.toCharArray(),
|
||||
JdtCompilerUtil.COMPILER_OPTIONS
|
||||
);
|
||||
@@ -389,9 +390,9 @@ public class ParserTests {
|
||||
+ "(" + problemFound.getSourceLineNumber() + ")"
|
||||
);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.lang.Math.tanh;
|
||||
import static java.lang.Math.tanh;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.List;
|
||||
import java.util.Comparator;
|
||||
|
||||
Reference in New Issue
Block a user