Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
29 lines
597 B
Go
29 lines
597 B
Go
package ast
|
|
|
|
import "github.com/sqlc-dev/sqlc/internal/sql/format"
|
|
|
|
type NamedArgExpr struct {
|
|
Tag NodeTag[NamedArgExpr] `json:"tag"`
|
|
|
|
Xpr Node `json:"xpr,omitempty"`
|
|
Arg Node `json:"arg,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Argnumber int `json:"argnumber"`
|
|
Location int `json:"location"`
|
|
}
|
|
|
|
func (n *NamedArgExpr) Pos() int {
|
|
return n.Location
|
|
}
|
|
|
|
func (n *NamedArgExpr) Format(buf *TrackedBuffer, d format.Dialect) {
|
|
if n == nil {
|
|
return
|
|
}
|
|
if n.Name != nil {
|
|
buf.WriteString(*n.Name)
|
|
}
|
|
buf.WriteString(" => ")
|
|
buf.astFormat(n.Arg, d)
|
|
}
|