MCPcopy Create free account
hub / github.com/cel-expr/cel-go / VisitDouble

Method VisitDouble

parser/parser.go:798–809  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#Double.

(ctx *gen.DoubleContext)

Source from the content-addressed store, hash-verified

796
797// Visit a parse tree produced by CELParser#Double.
798func (p *parser) VisitDouble(ctx *gen.DoubleContext) any {
799 txt := ctx.GetTok().GetText()
800 if ctx.GetSign() != nil {
801 txt = ctx.GetSign().GetText() + txt
802 }
803 f, err := strconv.ParseFloat(txt, 64)
804 if err != nil {
805 return p.reportError(ctx, "invalid double literal")
806 }
807 return p.helper.newLiteralDouble(ctx, f)
808
809}
810
811// Visit a parse tree produced by CELParser#String.
812func (p *parser) VisitString(ctx *gen.StringContext) any {

Callers 1

VisitMethod · 0.95

Calls 5

reportErrorMethod · 0.95
GetTextMethod · 0.80
newLiteralDoubleMethod · 0.80
GetTokMethod · 0.45
GetSignMethod · 0.45

Tested by

no test coverage detected