neuland/jade4j

Defining functions doesn't work

Closed this issue · 1 comments

Jade4j does not seem to support defining functions, even though the JEXL documentation linked from readme lists it as part of JEXL syntax. Trying the example from documentation:

- var fun = function(x, y) { x + y }

causes

org.apache.commons.jexl2.JexlException$Parsing:
de.neuland.jade4j.expression.JexlExpressionHandler.evaluateExpression@1:31
parsing error near '... + y } ...'
	at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:1260)
	at org.apache.commons.jexl2.JexlEngine.createScript(JexlEngine.java:506)
	at org.apache.commons.jexl2.JexlEngine.createScript(JexlEngine.java:452)
	at de.neuland.jade4j.expression.JexlExpressionHandler.evaluateExpression(JexlExpressionHandler.java:46)
	... 31 more

Should work with https://github.com/neuland/pug4j
Because it now uses jexl3