mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Support static import.
This commit is contained in:
@@ -284,6 +284,12 @@ public class PdeEmitter implements PdeTokenTypes
|
||||
print(ast.getFirstChild());
|
||||
break;
|
||||
|
||||
case STATIC_IMPORT:
|
||||
out.print("import static");
|
||||
dumpHiddenAfter(ast);
|
||||
print(ast.getFirstChild());
|
||||
break;
|
||||
|
||||
case CLASS_DEF:
|
||||
case INTERFACE_DEF:
|
||||
print(getChild(ast, MODIFIERS));
|
||||
|
||||
@@ -197,7 +197,7 @@ public class PdePreprocessor {
|
||||
}
|
||||
|
||||
//String importRegexp = "(?:^|\\s|;)(import\\s+)(\\S+)(\\s*;)";
|
||||
String importRegexp = "(?:^|;)\\s*(import\\s+)(\\S+)(\\s*;)";
|
||||
String importRegexp = "(?:^|;)\\s*(import\\s+)((?:static\\s+)?\\S+)(\\s*;)";
|
||||
programImports = new ArrayList<String>();
|
||||
|
||||
do {
|
||||
@@ -379,12 +379,12 @@ public class PdePreprocessor {
|
||||
emitter.setOut(stream);
|
||||
emitter.print(rootNode);
|
||||
|
||||
// debugAST(rootNode, false);
|
||||
// final ByteArrayOutputStream buf = new ByteArrayOutputStream();
|
||||
// final PrintStream bufout = new PrintStream(buf);
|
||||
// emitter.setOut(bufout);
|
||||
// emitter.print(rootNode);
|
||||
// System.err.println(new String(buf.toByteArray()));
|
||||
debugAST(rootNode, false);
|
||||
final ByteArrayOutputStream buf = new ByteArrayOutputStream();
|
||||
final PrintStream bufout = new PrintStream(buf);
|
||||
emitter.setOut(bufout);
|
||||
emitter.print(rootNode);
|
||||
System.err.println(new String(buf.toByteArray()));
|
||||
|
||||
writeFooter(stream, name);
|
||||
stream.close();
|
||||
|
||||
Reference in New Issue
Block a user