| 339 | } |
| 340 | |
| 341 | func (c *cc) convertComparison(n *parser.Expr_comparisonContext) ast.Node { |
| 342 | lexpr := c.convert(n.Expr(0)) |
| 343 | |
| 344 | if n.IN_() != nil { |
| 345 | rexprs := []ast.Node{} |
| 346 | for _, expr := range n.AllExpr()[1:] { |
| 347 | e := c.convert(expr) |
| 348 | switch t := e.(type) { |
| 349 | case *ast.List: |
| 350 | rexprs = append(rexprs, t.Items...) |
| 351 | default: |
| 352 | rexprs = append(rexprs, t) |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | return &ast.In{ |
| 357 | Expr: lexpr, |
| 358 | List: rexprs, |
| 359 | Not: false, |
| 360 | Sel: nil, |
| 361 | Location: n.GetStart().GetStart(), |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | return &ast.A_Expr{ |
| 366 | Name: &ast.List{ |
| 367 | Items: []ast.Node{ |
| 368 | &ast.String{Str: "="}, // TODO: add actual comparison |
| 369 | }, |
| 370 | }, |
| 371 | Lexpr: lexpr, |
| 372 | Rexpr: c.convert(n.Expr(1)), |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | func (c *cc) convertMultiSelect_stmtContext(n *parser.Select_stmtContext) ast.Node { |
| 377 | var ctes ast.List |