From 5385dafbf09433c3c5f84907275d600efe820485 Mon Sep 17 00:00:00 2001 From: A Pottinger Date: Sat, 29 Jan 2022 15:11:38 -0800 Subject: [PATCH] Added a little documentation related to #290. --- java/src/processing/mode/java/preproc/Processing.g4 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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