groovy-eclipse
groovy-eclipse copied to clipboard
Implement error recovery for antlr4-based Parrot Parser
Now that Groovy 4 is GA and has dropped antlr2 support this needs to be completed sooner rather than later.
@Spitfire1900 This project still provides the antlr2 parser for Groovy 4. You may also use the antlr4 parser, it's just not enabled by default. If you have antlr4 knowledge that would help move this ticket along, I'm ready and available to review design proposals.
My users also like to use new language features like Java-style Lambda syntax, but without error recovery, the use of the editor is very problematic for my users.
For those whom are on Groovy 3 and want to disable the parrot parser in builds this is how you can implement it in Gradle.
build.gradle
tasks.withType(GroovyCompile) {
groovyOptions.configurationScript = file("$projectDir/antlr2.groovy")
}
antlr2.groovy
import static org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder.*
import static org.codehaus.groovy.control.ParserPluginFactory.antlr2
import org.codehaus.groovy.control.CompilerConfiguration
withConfig (configuration) {
(configuration as CompilerConfiguration).pluginFactory = antlr2()
}