(expr ast.Expr)
| 113 | } |
| 114 | |
| 115 | func (un *unparser) visitCall(expr ast.Expr) error { |
| 116 | c := expr.AsCall() |
| 117 | fun := c.FunctionName() |
| 118 | switch fun { |
| 119 | // ternary operator |
| 120 | case operators.Conditional: |
| 121 | return un.visitCallConditional(expr) |
| 122 | // optional select operator |
| 123 | case operators.OptSelect: |
| 124 | return un.visitOptSelect(expr) |
| 125 | // index operator |
| 126 | case operators.Index: |
| 127 | return un.visitCallIndex(expr) |
| 128 | // optional index operator |
| 129 | case operators.OptIndex: |
| 130 | return un.visitCallOptIndex(expr) |
| 131 | // unary operators |
| 132 | case operators.LogicalNot, operators.Negate: |
| 133 | return un.visitCallUnary(expr) |
| 134 | // binary operators |
| 135 | case operators.Add, |
| 136 | operators.Divide, |
| 137 | operators.Equals, |
| 138 | operators.Greater, |
| 139 | operators.GreaterEquals, |
| 140 | operators.In, |
| 141 | operators.Less, |
| 142 | operators.LessEquals, |
| 143 | operators.LogicalAnd, |
| 144 | operators.LogicalOr, |
| 145 | operators.Modulo, |
| 146 | operators.Multiply, |
| 147 | operators.NotEquals, |
| 148 | operators.OldIn, |
| 149 | operators.Subtract: |
| 150 | return un.visitCallBinary(expr) |
| 151 | // standard function calls. |
| 152 | default: |
| 153 | return un.visitCallFunc(expr) |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func (un *unparser) visitCallBinary(expr ast.Expr) error { |
| 158 | c := expr.AsCall() |
no test coverage detected