(e ast.Expr)
| 980 | } |
| 981 | |
| 982 | func isAggFunc(e ast.Expr) *ast.AggregateOp { |
| 983 | call, ok := e.(*ast.CallExpr) |
| 984 | if !ok { |
| 985 | return nil |
| 986 | } |
| 987 | name, ok := call.Func.(*ast.FuncNameExpr) |
| 988 | if !ok { |
| 989 | return nil |
| 990 | } |
| 991 | if _, err := agg.NewPattern(name.Name, false, true); err != nil { |
| 992 | return nil |
| 993 | } |
| 994 | return &ast.AggregateOp{ |
| 995 | Kind: "AggregateOp", |
| 996 | Aggs: []ast.Assignment{{ |
| 997 | RHS: call, |
| 998 | }}, |
| 999 | } |
| 1000 | } |
| 1001 | |
| 1002 | func IsBool(e ast.Expr) bool { |
| 1003 | switch e := e.(type) { |
no test coverage detected