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

Method VisitCreateMessage

parser/antlr_parser.go:537–551  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#CreateMessage.

(ctx *gen.CreateMessageContext)

Source from the content-addressed store, hash-verified

535
536// Visit a parse tree produced by CELParser#CreateMessage.
537func (p *antlrVisitor) VisitCreateMessage(ctx *gen.CreateMessageContext) any {
538 messageName := ""
539 for _, id := range ctx.GetIds() {
540 if len(messageName) != 0 {
541 messageName += "."
542 }
543 messageName += id.GetText()
544 }
545 if ctx.GetLeadingDot() != nil {
546 messageName = "." + messageName
547 }
548 objID := p.helper.id(ctx.GetOp())
549 entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]ast.EntryExpr)
550 return p.helper.newObject(objID, messageName, entries...)
551}
552
553// Visit a parse tree of field initializers.
554func (p *antlrVisitor) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext) any {

Callers 1

VisitMethod · 0.95

Calls 8

GetTextMethod · 0.80
idMethod · 0.80
newObjectMethod · 0.80
GetLeadingDotMethod · 0.65
GetOpMethod · 0.65
GetIdsMethod · 0.45
GetEntriesMethod · 0.45

Tested by

no test coverage detected