MCPcopy Create free account
hub / github.com/cel-expr/cel-go / VisitCreateStruct

Method VisitCreateStruct

parser/parser.go:723–730  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#CreateStruct.

(ctx *gen.CreateStructContext)

Source from the content-addressed store, hash-verified

721
722// Visit a parse tree produced by CELParser#CreateStruct.
723func (p *parser) VisitCreateStruct(ctx *gen.CreateStructContext) any {
724 structID := p.helper.id(ctx.GetOp())
725 entries := []ast.EntryExpr{}
726 if ctx.GetEntries() != nil {
727 entries = p.Visit(ctx.GetEntries()).([]ast.EntryExpr)
728 }
729 return p.helper.newMap(structID, entries...)
730}
731
732// Visit a parse tree produced by CELParser#mapInitializerList.
733func (p *parser) VisitMapInitializerList(ctx *gen.MapInitializerListContext) any {

Callers 1

VisitMethod · 0.95

Calls 5

VisitMethod · 0.95
idMethod · 0.80
newMapMethod · 0.80
GetOpMethod · 0.65
GetEntriesMethod · 0.45

Tested by

no test coverage detected