EdgeVerve / feel

Expression Language for creating and executing business rules in decision table based on DMN 1.1 specification for conformance level 3
MIT License
93 stars 48 forks source link

"not(>=123,456)" is also parsed as valid #8

Closed gustavomick closed 7 years ago

gustavomick commented 7 years ago

hi, i was testing few examples and looks like this case is not working.

pragyandas commented 7 years ago

The syntax mentioned in 10.3.2.3.1 (quoted below) is not implemented in the current version.

The number(from, grouping separator, decimal separator) built-in function supports a richer literal format. For example, FEEL(number("1.000.000,01", ".", ",")) = 1000000.01.

pragyandas commented 7 years ago

Moreover, the mentioned expression is valid and is parsed as "simple unary tests".

14 simple unary tests = 14.a simple positive unary tests | 14.b "not", "(", simple positive unary tests, ")" | 14.c "-";

An expression to be tested satisfies an instance of simple unary tests (grammar rule 14) if and only if, either the expression is a list and the expression satisfies at least one simple unitary test in the list, or the simple unitary tests is “-”.

The above expression is equivalent to not( x >= 123 or x == 456) where is x is some variable.

Note : If you intend to use 123,456 as number, then it needs to be wrapped in number in-built function as mentioned in the previous comment.

pragyandas commented 7 years ago

Need to add number in-built function as enhancement.