[ https://issues.apache.org/jira/browse/GROOVY-11532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907134#comment-17907134 ]
Paul King commented on GROOVY-11532: ------------------------------------ This is actually by design. With the parrot parser, this: {code:java} this is not valid{code} is actually parsed as: {code:java} this(is).not(valid){code} This will give a runtime error unless "is" and "valid", and a "this" method are not supplied in the binding or as part of configuration. E.g.: the following prints FOO {code:java} binding.variables.this = { it } is = [not: { arg -> println arg.toUpperCase() }] valid = 'foo' this is not valid {code} I supplied things like "is" and "valid" in the script but they could be supplied via the binding or other script configuration. You can make it fail at compile time using type checking/static compilation. These can be enabled as switches to the compiler, via a configscript, as annotations in the source code or as configuration to GroovyShell. Have a look at some ASTTransformationCustomizer examples. > Parrot Parser doesn't seem to ever throw error on parse. > -------------------------------------------------------- > > Key: GROOVY-11532 > URL: https://issues.apache.org/jira/browse/GROOVY-11532 > Project: Groovy > Issue Type: Bug > Components: parser-antlr4 > Affects Versions: 3.0.22, 3.0.23 > Reporter: Karl Henselin > Priority: Major > > I created a small test project for this issue. > > [https://github.com/karlhenselin/testGroovy] > using the prior parser, > new GroovyShell().parse("this is not valid;asdf;asdf;asdf;asdf;asdf "); > throws MultipleCompilationErrorsException > but on the new parser, no error is thrown on that line. > I have tried adding options to try and get it to throw, but I can can get to > work is > System.setProperty("groovy.antlr4", "false"); -- This message was sent by Atlassian Jira (v8.20.10#820010)