MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / VisitPre

Method VisitPre

pkg/sql/sem/tree/normalize.go:818–834  ·  view source on GitHub ↗
(expr Expr)

Source from the content-addressed store, hash-verified

816var _ Visitor = &isConstVisitor{}
817
818func (v *isConstVisitor) VisitPre(expr Expr) (recurse bool, newExpr Expr) {
819 if v.isConst {
820 if isVar(v.ctx, expr, true /*allowConstPlaceholders*/) {
821 v.isConst = false
822 return false, expr
823 }
824
825 switch t := expr.(type) {
826 case *FuncExpr:
827 if t.IsImpure() {
828 v.isConst = false
829 return false, expr
830 }
831 }
832 }
833 return true, expr
834}
835
836func (*isConstVisitor) VisitPost(expr Expr) Expr { return expr }
837

Callers

nothing calls this directly

Calls 2

isVarFunction · 0.85
IsImpureMethod · 0.80

Tested by

no test coverage detected