VisitBoundsBlock visits a parse tree produced by MangleParser#boundsBlock.
(ctx *gen.BoundsBlockContext)
| 304 | |
| 305 | // VisitBoundsBlock visits a parse tree produced by MangleParser#boundsBlock. |
| 306 | func (p Parser) VisitBoundsBlock(ctx *gen.BoundsBlockContext) any { |
| 307 | var baseTerms []ast.BaseTerm |
| 308 | for _, t := range ctx.AllTerm() { |
| 309 | term := p.Visit(t).(ast.Term) |
| 310 | baseTerm, ok := term.(ast.BaseTerm) |
| 311 | if !ok { |
| 312 | p.errors.Add(fmt.Sprintf("expected base term got %v", term), ctx.GetStart().GetLine(), ctx.GetStart().GetColumn()) |
| 313 | baseTerms = append(baseTerms, ast.AnyBound) |
| 314 | } |
| 315 | baseTerms = append(baseTerms, baseTerm) |
| 316 | } |
| 317 | return ast.NewBoundDecl(baseTerms...) |
| 318 | } |
| 319 | |
| 320 | // VisitConstraintsBlock visits a parse tree produced by MangleParser#constraintsBlock. |
| 321 | func (p Parser) VisitConstraintsBlock(ctx *gen.ConstraintsBlockContext) any { |
no test coverage detected