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