mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix for preproc errors with 'public class' (issue #292)
This commit is contained in:
@@ -446,8 +446,12 @@ public class PdePreprocessor implements PdeTokenTypes {
|
||||
parser.setASTNodeClass("antlr.ExtendedCommonASTWithHiddenTokens");
|
||||
|
||||
if (PUBLIC_CLASS.matcher(program).find()) {
|
||||
setMode(Mode.JAVA);
|
||||
parser.javaProgram();
|
||||
try {
|
||||
parser.javaProgram();
|
||||
setMode(Mode.JAVA);
|
||||
} catch (Exception e) {
|
||||
parser.pdeProgram();
|
||||
}
|
||||
} else if (FUNCTION_DECL.matcher(program).find()) {
|
||||
setMode(Mode.ACTIVE);
|
||||
parser.activeProgram();
|
||||
|
||||
Reference in New Issue
Block a user