MCPcopy Index your code
hub / github.com/google/mangle / VisitFloat

Method VisitFloat

parse/parse.go:495–502  ·  view source on GitHub ↗

VisitFloat visits a parse tree produced by MangleParser#Float.

(ctx *gen.FloatContext)

Source from the content-addressed store, hash-verified

493
494// VisitFloat visits a parse tree produced by MangleParser#Float.
495func (p Parser) VisitFloat(ctx *gen.FloatContext) any {
496 floatNum, err := strconv.ParseFloat(ctx.FLOAT().GetText(), 64)
497 if err != nil {
498 p.errors.Add(err.Error(), ctx.GetStart().GetLine(), ctx.GetStart().GetColumn())
499 return ast.Float64(-1)
500 }
501 return ast.Float64(floatNum)
502}
503
504// VisitStr visits a parse tree produced by MangleParser#Str.
505func (p Parser) VisitStr(ctx *gen.StrContext) any {

Callers 1

VisitMethod · 0.95

Calls 4

Float64Function · 0.92
FLOATMethod · 0.80
ErrorMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected