Boolean expression evaluation purely written in Swift for macOS & Linux without any dependencies.
let expression = try Phrase("list != nil && list.count > 3")
expression.context = [
"list": [1,2,3,4,5]
]
if try expression.evaluate() {
...
} else {
...
}
Operators which require a succeeding node
!
Operators which require a preceding and a succeeding node
&&
||
==
!=
>
>=
<
<=
Operators which require a preceeding node
count
returns the element count of the preceeding array node