MCPcopy
hub / github.com/sqlc-dev/sqlc / convertCastExpr

Method convertCastExpr

internal/engine/sqlite/convert.go:1198–1211  ·  view source on GitHub ↗
(n *parser.Expr_castContext)

Source from the content-addressed store, hash-verified

1196}
1197
1198func (c *cc) convertCastExpr(n *parser.Expr_castContext) ast.Node {
1199 name := n.Type_name().GetText()
1200 return &ast.TypeCast{
1201 Arg: c.convert(n.Expr()),
1202 TypeName: &ast.TypeName{
1203 Name: name,
1204 Names: &ast.List{Items: []ast.Node{
1205 NewIdentifier(name),
1206 }},
1207 ArrayBounds: &ast.List{},
1208 },
1209 Location: n.GetStart().GetStart(),
1210 }
1211}
1212
1213func (c *cc) convertCollateExpr(n *parser.Expr_collateContext) ast.Node {
1214 return &ast.CollateExpr{

Callers 1

convertMethod · 0.95

Calls 6

convertMethod · 0.95
GetTextMethod · 0.80
GetStartMethod · 0.80
NewIdentifierFunction · 0.70
Type_nameMethod · 0.65
ExprMethod · 0.65

Tested by

no test coverage detected