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:
Sam Pottinger
2019-11-04 16:54:22 -08:00
parent 9d9c7cc043
commit c458863dd7
9 changed files with 126 additions and 88 deletions

View File

@@ -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;
}
}

View File

@@ -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;