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

Method VisitCreateMessage

parser/parser.go:622–636  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#CreateMessage.

(ctx *gen.CreateMessageContext)

Source from the content-addressed store, hash-verified

620
621// Visit a parse tree produced by CELParser#CreateMessage.
622func (p *parser) VisitCreateMessage(ctx *gen.CreateMessageContext) any {
623 messageName := ""
624 for _, id := range ctx.GetIds() {
625 if len(messageName) != 0 {
626 messageName += "."
627 }
628 messageName += id.GetText()
629 }
630 if ctx.GetLeadingDot() != nil {
631 messageName = "." + messageName
632 }
633 objID := p.helper.id(ctx.GetOp())
634 entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]ast.EntryExpr)
635 return p.helper.newObject(objID, messageName, entries...)
636}
637
638// Visit a parse tree of field initializers.
639func (p *parser) 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