Visit a parse tree produced by CELParser#Uint.
(ctx *gen.UintContext)
| 779 | |
| 780 | // Visit a parse tree produced by CELParser#Uint. |
| 781 | func (p *parser) VisitUint(ctx *gen.UintContext) any { |
| 782 | text := ctx.GetTok().GetText() |
| 783 | // trim the 'u' designator included in the uint literal. |
| 784 | text = text[:len(text)-1] |
| 785 | base := 10 |
| 786 | if strings.HasPrefix(text, "0x") { |
| 787 | base = 16 |
| 788 | text = text[2:] |
| 789 | } |
| 790 | i, err := strconv.ParseUint(text, base, 64) |
| 791 | if err != nil { |
| 792 | return p.reportError(ctx, "invalid uint literal") |
| 793 | } |
| 794 | return p.helper.newLiteralUint(ctx, i) |
| 795 | } |
| 796 | |
| 797 | // Visit a parse tree produced by CELParser#Double. |
| 798 | func (p *parser) VisitDouble(ctx *gen.DoubleContext) any { |
no test coverage detected