VisitAtom visits a parse tree produced by MangleParser#atoms.
(ctx *gen.AtomContext)
| 611 | |
| 612 | // VisitAtom visits a parse tree produced by MangleParser#atoms. |
| 613 | func (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. |
| 624 | func (p Parser) VisitAtoms(ctx *gen.AtomsContext) any { |