mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Funny bug. The grammar accepted any initial chunk of an active or static program as the whole thing, because it wasn't saying that the EOF had to come next!
This commit is contained in:
+5
-5
@@ -46,10 +46,10 @@ pdeProgram
|
||||
// imports (and they must have at least one)
|
||||
: ( "public" "class" | "import" ) => javaProgram
|
||||
{ pp.setProgramType(PdePreprocessor.ProgramType.JAVA); }
|
||||
| ((statement)*) => staticProgram
|
||||
{ pp.setProgramType(PdePreprocessor.ProgramType.STATIC); }
|
||||
| activeProgram
|
||||
| (activeProgram) => activeProgram
|
||||
{ pp.setProgramType(PdePreprocessor.ProgramType.ACTIVE); }
|
||||
| staticProgram
|
||||
{ pp.setProgramType(PdePreprocessor.ProgramType.STATIC); }
|
||||
|
||||
;
|
||||
|
||||
@@ -59,11 +59,11 @@ javaProgram
|
||||
;
|
||||
|
||||
activeProgram
|
||||
: (possiblyEmptyField)+
|
||||
: (possiblyEmptyField)+ EOF!
|
||||
;
|
||||
|
||||
staticProgram
|
||||
: (statement)*
|
||||
: (statement)* EOF!
|
||||
;
|
||||
|
||||
// copy of the java.g rule with WEBCOLOR_LITERAL added
|
||||
|
||||
Reference in New Issue
Block a user