Visit a parse tree produced by CELParser#Double.
(ctx *gen.DoubleContext)
| 804 | |
| 805 | // Visit a parse tree produced by CELParser#Double. |
| 806 | func (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. |
| 820 | func (p *parser) VisitString(ctx *gen.StringContext) any { |
no test coverage detected