EvalEx icon indicating copy to clipboard operation
EvalEx copied to clipboard

does not evaluate if expression operand has a period, hyphen seperater

Open Manan-13 opened this issue 1 year ago • 1 comments

"{airQuality.temperature} > 44"

Map<String, Object> values = new HashMap<>(); values.put("a-b", "indoor"); EvaluationValue result = e.withValues(values).evaluate();

BaseException(startPosition=4, endPosition=5, tokenString=a, message=Variable or constant value for 'a' not found) at Main.main(Main.java:24) Caused by: BaseException(startPosition=4, endPosition=5, tokenString=a, message=Variable or constant value for 'a' not found)

Any workaround for this ?

Manan-13 avatar Jul 09 '24 12:07 Manan-13

dot (.) and hyphen (-) are reserved operators from the library. I would suggest you replace those special characters with underscore (_) when creating expressions and passing in variables.

stevenylai avatar Jul 11 '24 06:07 stevenylai

Closing this, we won't support special characters apart from underscore in variable names.

uklimaschewski avatar Sep 15 '24 09:09 uklimaschewski