diff --git a/java/src/processing/mode/java/preproc/Processing.g4 b/java/src/processing/mode/java/preproc/Processing.g4 index 2c370eff0..5e091aefa 100644 --- a/java/src/processing/mode/java/preproc/Processing.g4 +++ b/java/src/processing/mode/java/preproc/Processing.g4 @@ -41,16 +41,17 @@ activeProcessingSketch : (importDeclaration | classBodyDeclaration)* EOF ; -variableDeclaratorId - : warnTypeAsVariableName - | IDENTIFIER ('[' ']')* - ; - +// User incorrectly mixing modes. Included to allow for kind error message. warnMixedModes : (importDeclaration | classBodyDeclaration | blockStatement)* blockStatement classBodyDeclaration (importDeclaration | classBodyDeclaration | blockStatement)* | (importDeclaration | classBodyDeclaration | blockStatement)* classBodyDeclaration blockStatement (importDeclaration | classBodyDeclaration | blockStatement)* ; +variableDeclaratorId + : warnTypeAsVariableName + | IDENTIFIER ('[' ']')* + ; + // bug #93 // https://github.com/processing/processing/issues/93 // prevent from types being used as variable names