| 519 | } |
| 520 | |
| 521 | func (t *translator) doubleQuoteExpr(d *ast.DoubleQuoteExpr, inType super.Type) (sem.Expr, super.Type) { |
| 522 | // Check if there's a SQL scope and treat a double-quoted string |
| 523 | // as an identifier. XXX we'll need to do something a bit more |
| 524 | // sophisticated to handle pipes inside SQL subqueries. |
| 525 | if t.scope.sql != nil { |
| 526 | if d.Text == "this" { |
| 527 | // Resolve directly here as column so it's not interpreted as this. |
| 528 | return t.scope.resolve(t, d, []string{"this"}, inType) |
| 529 | } |
| 530 | return t.expr(&ast.IDExpr{Kind: "IDExpr", ID: ast.ID{Name: d.Text, Loc: d.Loc}}, inType) |
| 531 | } |
| 532 | return t.expr(&ast.Primitive{ |
| 533 | Kind: "Primitive", |
| 534 | Type: "string", |
| 535 | Text: d.Text, |
| 536 | Loc: d.Loc, |
| 537 | }, inType) |
| 538 | } |
| 539 | |
| 540 | func (t *translator) existsExpr(e *ast.ExistsExpr, inType super.Type) (sem.Expr, super.Type) { |
| 541 | q, _ := t.subqueryExpr(e, true, e.Body, inType) |