MCPcopy Create free account
hub / github.com/brimdata/super / doubleQuoteExpr

Method doubleQuoteExpr

compiler/semantic/expr.go:521–538  ·  view source on GitHub ↗
(d *ast.DoubleQuoteExpr, inType super.Type)

Source from the content-addressed store, hash-verified

519}
520
521func (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
540func (t *translator) existsExpr(e *ast.ExistsExpr, inType super.Type) (sem.Expr, super.Type) {
541 q, _ := t.subqueryExpr(e, true, e.Body, inType)

Callers 1

exprMethod · 0.95

Calls 2

exprMethod · 0.95
resolveMethod · 0.45

Tested by

no test coverage detected