MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / visitCreateMessage

Method visitCreateMessage

parser/parser.cc:1078–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1076}
1077
1078std::any ParserVisitor::visitCreateMessage(
1079 CelParser::CreateMessageContext* ctx) {
1080 std::vector<std::string> parts;
1081 parts.reserve(ctx->ids.size());
1082 for (const auto* id : ctx->ids) {
1083 parts.push_back(id->getText());
1084 }
1085 std::string name;
1086 if (ctx->leadingDot) {
1087 name.push_back('.');
1088 name.append(absl::StrJoin(parts, "."));
1089 } else {
1090 name = absl::StrJoin(parts, ".");
1091 }
1092 int64_t obj_id = factory_.NextId(SourceRangeFromToken(ctx->op));
1093 std::vector<StructExprField> fields;
1094 if (ctx->entries) {
1095 fields = visitFields(ctx->entries);
1096 }
1097 return ExprToAny(
1098 factory_.NewStruct(obj_id, std::move(name), std::move(fields)));
1099}
1100
1101std::any ParserVisitor::visitFieldInitializerList(
1102 CelParser::FieldInitializerListContext* ctx) {

Callers

nothing calls this directly

Calls 6

SourceRangeFromTokenFunction · 0.85
ExprToAnyFunction · 0.85
getTextMethod · 0.80
sizeMethod · 0.45
NextIdMethod · 0.45
NewStructMethod · 0.45

Tested by

no test coverage detected