MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / convertBinaryOperationExpr

Method convertBinaryOperationExpr

internal/engine/dolphin/convert.go:189–218  ·  view source on GitHub ↗
(n *pcast.BinaryOperationExpr)

Source from the content-addressed store, hash-verified

187}
188
189func (c *cc) convertBinaryOperationExpr(n *pcast.BinaryOperationExpr) ast.Node {
190 if n.Op == opcode.LogicAnd || n.Op == opcode.LogicOr {
191 var boolop ast.BoolExprType
192 if n.Op == opcode.LogicAnd {
193 boolop = ast.BoolExprTypeAnd
194 } else {
195 boolop = ast.BoolExprTypeOr
196 }
197 return &ast.BoolExpr{
198 Boolop: boolop,
199 Args: &ast.List{
200 Items: []ast.Node{
201 c.convert(n.L),
202 c.convert(n.R),
203 },
204 },
205 }
206 } else {
207 return &ast.A_Expr{
208 // TODO: Set kind
209 Name: &ast.List{
210 Items: []ast.Node{
211 &ast.String{Str: opToName(n.Op)},
212 },
213 },
214 Lexpr: c.convert(n.L),
215 Rexpr: c.convert(n.R),
216 }
217 }
218}
219
220func (c *cc) convertCreateTableStmt(n *pcast.CreateTableStmt) ast.Node {
221 create := &ast.CreateTableStmt{

Callers 1

convertMethod · 0.95

Calls 2

convertMethod · 0.95
opToNameFunction · 0.85

Tested by

no test coverage detected