MCPcopy
hub / github.com/google/mangle / VisitAtom

Method VisitAtom

parse/parse.go:613–621  ·  view source on GitHub ↗

VisitAtom visits a parse tree produced by MangleParser#atoms.

(ctx *gen.AtomContext)

Source from the content-addressed store, hash-verified

611
612// VisitAtom visits a parse tree produced by MangleParser#atoms.
613func (p Parser) VisitAtom(ctx *gen.AtomContext) any {
614 term := p.Visit(ctx.Term())
615 atom, ok := term.(ast.Atom)
616 if !ok {
617 p.errors.Add(fmt.Sprintf("expected atom got %v", term), ctx.GetStart().GetLine(), ctx.GetStart().GetColumn())
618 return ast.NewAtom("b0rken")
619 }
620 return atom
621}
622
623// VisitAtoms visits a parse tree produced by MangleParser#atoms.
624func (p Parser) VisitAtoms(ctx *gen.AtomsContext) any {

Callers 1

VisitMethod · 0.95

Calls 4

VisitMethod · 0.95
NewAtomFunction · 0.92
TermMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected