Evaluate a boolean expression.
import ba "github.com/lesomnus/boolal"
func Expression() {
data := map[string]bool{"t": true}
expr, err := ba.ParseString("t & f | !(t | f)")
if err != nil {
panic(err)
}
ok := expr.Eval(data)
// ok == false
}
func Manipulation() {
data := map[string]bool{"t": true}
expr := ba.And("t", "f").Or(ba.Not(ba.Or("t", "f")))
ok := expr.Eval(data)
// ok == false
}