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

Method VisitBoundsBlock

parse/parse.go:306–318  ·  view source on GitHub ↗

VisitBoundsBlock visits a parse tree produced by MangleParser#boundsBlock.

(ctx *gen.BoundsBlockContext)

Source from the content-addressed store, hash-verified

304
305// VisitBoundsBlock visits a parse tree produced by MangleParser#boundsBlock.
306func (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.
321func (p Parser) VisitConstraintsBlock(ctx *gen.ConstraintsBlockContext) any {

Callers 1

VisitMethod · 0.95

Calls 4

VisitMethod · 0.95
NewBoundDeclFunction · 0.92
AllTermMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected