Let Groovy deal with Java keywords like null, case, etc

This commit is contained in:
Reinhard Pointner 2016-10-01 01:49:24 +08:00
parent a589cb1dcd
commit 527cd91a0d
1 changed files with 1 additions and 1 deletions

View File

@ -246,7 +246,7 @@ public class ExpressionFormat extends Format {
protected static synchronized CompiledScript compileScriptlet(String expression) throws ScriptException { protected static synchronized CompiledScript compileScriptlet(String expression) throws ScriptException {
// simple expressions like {n} don't need to be interpreted by the script engine // simple expressions like {n} don't need to be interpreted by the script engine
if (SourceVersion.isIdentifier(expression)) { if (SourceVersion.isIdentifier(expression) && !SourceVersion.isKeyword(expression)) {
return new Variable(expression); return new Variable(expression);
} }