Minor style improvements in antlr grammars.

This commit is contained in:
A Pottinger
2022-01-30 09:42:50 -08:00
parent eccfe46724
commit 8ff88f7d14
2 changed files with 15 additions and 10 deletions
@@ -299,8 +299,13 @@ literal
| NULL_LITERAL
;
baseStringLiteral: STRING_LITERAL;
multilineStringLiteral: MULTI_STRING_LIT;
baseStringLiteral
: STRING_LITERAL
;
multilineStringLiteral
: MULTI_STRING_LIT
;
stringLiteral
: baseStringLiteral
@@ -23,7 +23,7 @@ processingSketch
: javaProcessingSketch
| staticProcessingSketch
| activeProcessingSketch
| warnMixedModes
| warnMixedModes
;
// java mode, is a compilation unit
@@ -44,8 +44,8 @@ activeProcessingSketch
// 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)*
;
| (importDeclaration | classBodyDeclaration | blockStatement)* classBodyDeclaration blockStatement (importDeclaration | classBodyDeclaration | blockStatement)*
;
variableDeclaratorId
: warnTypeAsVariableName
@@ -73,12 +73,12 @@ methodCall
// "color" is a special Processing primitive (== int)
functionWithPrimitiveTypeName
: ( 'boolean'
| 'byte'
| 'char'
| 'float'
| 'int'
| 'byte'
| 'char'
| 'float'
| 'int'
| 'color'
) '(' expressionList? ')'
) '(' expressionList? ')'
;
// adding support for "color" primitive