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

Method visitGlobalCall

parser/parser.cc:1165–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163}
1164
1165std::any ParserVisitor::visitGlobalCall(CelParser::GlobalCallContext* ctx) {
1166 std::string ident_name;
1167 if (ctx->leadingDot) {
1168 ident_name = ".";
1169 }
1170 if (!ctx->id || !ctx->op) {
1171 return ExprToAny(factory_.NewUnspecified(
1172 factory_.NextId(SourceRangeFromParserRuleContext(ctx))));
1173 }
1174 // check if ID is in reserved identifiers
1175 if (cel::internal::LexisIsReserved(ctx->id->getText())) {
1176 return ExprToAny(factory_.ReportError(
1177 SourceRangeFromParserRuleContext(ctx),
1178 absl::StrFormat("reserved identifier: %s", ctx->id->getText())));
1179 }
1180
1181 ident_name += ctx->id->getText();
1182
1183 int64_t op_id = factory_.NextId(SourceRangeFromToken(ctx->op));
1184 auto args = visitList(ctx->args);
1185 return ExprToAny(
1186 GlobalCallOrMacroImpl(op_id, std::move(ident_name), std::move(args)));
1187}
1188
1189std::any ParserVisitor::visitNested(CelParser::NestedContext* ctx) {
1190 return visit(ctx->e);

Callers

nothing calls this directly

Calls 8

ExprToAnyFunction · 0.85
LexisIsReservedFunction · 0.85
SourceRangeFromTokenFunction · 0.85
getTextMethod · 0.80
NewUnspecifiedMethod · 0.45
NextIdMethod · 0.45
ReportErrorMethod · 0.45

Tested by

no test coverage detected