(node *Node)
| 11 | type countAny struct{} |
| 12 | |
| 13 | func (*countAny) Visit(node *Node) { |
| 14 | binary, ok := (*node).(*BinaryNode) |
| 15 | if !ok { |
| 16 | return |
| 17 | } |
| 18 | |
| 19 | count, ok := binary.Left.(*BuiltinNode) |
| 20 | if !ok || count.Name != "count" || len(count.Arguments) != 2 { |
| 21 | return |
| 22 | } |
| 23 | |
| 24 | integer, ok := binary.Right.(*IntegerNode) |
| 25 | if !ok { |
| 26 | return |
| 27 | } |
| 28 | |
| 29 | if (binary.Operator == ">" && integer.Value == 0) || |
| 30 | (binary.Operator == ">=" && integer.Value == 1) { |
| 31 | patchCopyType(node, &BuiltinNode{ |
| 32 | Name: "any", |
| 33 | Arguments: count.Arguments, |
| 34 | }) |
| 35 | } |
| 36 | } |
nothing calls this directly
no test coverage detected