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

Method AsConstantValue

pkg/sql/sem/tree/constant.go:234–240  ·  view source on GitHub ↗

AsConstantValue returns the value as a constant numerical value, with the proper sign as given by expr.negative.

()

Source from the content-addressed store, hash-verified

232// AsConstantValue returns the value as a constant numerical value, with the proper sign
233// as given by expr.negative.
234func (expr *NumVal) AsConstantValue() constant.Value {
235 v := expr.value
236 if expr.negative {
237 v = constant.UnaryOp(token.SUB, v, 0)
238 }
239 return v
240}
241
242// AsConstantInt returns the value as an constant.Int if possible, along
243// with a flag indicating whether the conversion was possible.

Callers 3

AsConstantIntMethod · 0.95
ParseMethod · 0.80
VisitPostMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected