MCPcopy Create free account
hub / github.com/araddon/qlbridge / WriteDialect

Method WriteDialect

expr/node.go:1707–1732  ·  view source on GitHub ↗
(w DialectWriter)

Source from the content-addressed store, hash-verified

1705 return w.String()
1706}
1707func (m *UnaryNode) WriteDialect(w DialectWriter) {
1708 switch m.Operator.T {
1709 case lex.TokenNegate:
1710 if nn, ok := m.Arg.(NegateableNode); ok {
1711 nn.WriteNegate(w)
1712 return
1713 }
1714 io.WriteString(w, "NOT ")
1715 switch m.Arg.(type) {
1716 case *TriNode:
1717 io.WriteString(w, "(")
1718 m.Arg.WriteDialect(w)
1719 io.WriteString(w, ")")
1720 default:
1721 m.Arg.WriteDialect(w)
1722 }
1723 case lex.TokenExists:
1724 io.WriteString(w, "EXISTS ")
1725 m.Arg.WriteDialect(w)
1726 default:
1727 io.WriteString(w, m.Operator.V)
1728 io.WriteString(w, " (")
1729 m.Arg.WriteDialect(w)
1730 io.WriteString(w, ")")
1731 }
1732}
1733func (m *UnaryNode) Validate() error {
1734 return m.Arg.Validate()
1735}

Callers 1

StringMethod · 0.95

Calls 2

WriteNegateMethod · 0.65
WriteDialectMethod · 0.65

Tested by

no test coverage detected