Let Groovy deal with Java keywords like null, case, etc
This commit is contained in:
parent
a589cb1dcd
commit
527cd91a0d
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue