MCPcopy Create free account
hub / github.com/dolthub/doltgresql / typeCheckSplitExprs

Function typeCheckSplitExprs

postgres/parser/sem/tree/type_check.go:2215–2229  ·  view source on GitHub ↗

typeCheckSplitExprs splits the expressions into three groups of indexes: - Constants - Placeholders - All other Exprs

(
	ctx context.Context, semaCtx *SemaContext, exprs []Expr,
)

Source from the content-addressed store, hash-verified

2213// - Placeholders
2214// - All other Exprs
2215func typeCheckSplitExprs(
2216 ctx context.Context, semaCtx *SemaContext, exprs []Expr,
2217) (constIdxs []int, placeholderIdxs []int, resolvableIdxs []int) {
2218 for i, expr := range exprs {
2219 switch {
2220 case isConstant(expr):
2221 constIdxs = append(constIdxs, i)
2222 case semaCtx.isUnresolvedPlaceholder(expr):
2223 placeholderIdxs = append(placeholderIdxs, i)
2224 default:
2225 resolvableIdxs = append(resolvableIdxs, i)
2226 }
2227 }
2228 return constIdxs, placeholderIdxs, resolvableIdxs
2229}
2230
2231// typeCheckTupleComparison type checks a comparison between two tuples,
2232// asserting that the elements of the two tuples are comparable at each index.

Callers 2

TypeCheckSameTypedExprsFunction · 0.85
typeCheckOverloadedExprsFunction · 0.85

Calls 2

isConstantFunction · 0.85

Tested by

no test coverage detected