(expr ast.Expr)
| 149 | } |
| 150 | |
| 151 | func (un *unparser) visitCall(expr ast.Expr) error { |
| 152 | c := expr.AsCall() |
| 153 | fun := c.FunctionName() |
| 154 | switch fun { |
| 155 | // ternary operator |
| 156 | case operators.Conditional: |
| 157 | return un.visitCallConditional(expr) |
| 158 | // optional select operator |
| 159 | case operators.OptSelect: |
| 160 | return un.visitOptSelect(expr) |
| 161 | // index operator |
| 162 | case operators.Index: |
| 163 | return un.visitCallIndex(expr) |
| 164 | // optional index operator |
| 165 | case operators.OptIndex: |
| 166 | return un.visitCallOptIndex(expr) |
| 167 | // unary operators |
| 168 | case operators.LogicalNot, operators.Negate: |
| 169 | return un.visitCallUnary(expr) |
| 170 | // binary operators |
| 171 | case operators.Add, |
| 172 | operators.Divide, |
| 173 | operators.Equals, |
| 174 | operators.Greater, |
| 175 | operators.GreaterEquals, |
| 176 | operators.In, |
| 177 | operators.Less, |
| 178 | operators.LessEquals, |
| 179 | operators.LogicalAnd, |
| 180 | operators.LogicalOr, |
| 181 | operators.Modulo, |
| 182 | operators.Multiply, |
| 183 | operators.NotEquals, |
| 184 | operators.OldIn, |
| 185 | operators.Subtract: |
| 186 | return un.visitCallBinary(expr) |
| 187 | // standard function calls. |
| 188 | default: |
| 189 | return un.visitCallFunc(expr) |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | func (un *unparser) visitCallBinary(expr ast.Expr) error { |
| 194 | c := expr.AsCall() |
no test coverage detected