Example #1
0
func checkPredRes(ret tree.Result, f *xpFilt, node tree.Node) (bool, error) {
	if num, ok := ret.(tree.Num); ok {
		if float64(f.proxPos[node.Pos()]) == float64(num) {
			return true, nil
		}
		return false, nil
	}

	if b, ok := ret.(tree.IsBool); ok {
		return bool(b.Bool()), nil
	}

	return false, fmt.Errorf("Cannot convert argument to boolean")
}