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

Method VisitDouble

parser/parser.go:806–817  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#Double.

(ctx *gen.DoubleContext)

Source from the content-addressed store, hash-verified

804
805// Visit a parse tree produced by CELParser#Double.
806func (p *parser) VisitDouble(ctx *gen.DoubleContext) any {
807 txt := ctx.GetTok().GetText()
808 if ctx.GetSign() != nil {
809 txt = ctx.GetSign().GetText() + txt
810 }
811 f, err := strconv.ParseFloat(txt, 64)
812 if err != nil {
813 return p.reportError(ctx, "invalid double literal")
814 }
815 return p.helper.newLiteralDouble(ctx, f)
816
817}
818
819// Visit a parse tree produced by CELParser#String.
820func (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