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

Method visitIndex

parser/parser.cc:1065–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063}
1064
1065std::any ParserVisitor::visitIndex(CelParser::IndexContext* ctx) {
1066 auto target = ExprFromAny(visit(ctx->member()));
1067 int64_t op_id = factory_.NextId(SourceRangeFromToken(ctx->op));
1068 auto index = ExprFromAny(visit(ctx->index));
1069 if (!enable_optional_syntax_ && ctx->opt != nullptr) {
1070 return ExprToAny(factory_.ReportError(SourceRangeFromParserRuleContext(ctx),
1071 "unsupported syntax '.?'"));
1072 }
1073 return ExprToAny(GlobalCallOrMacro(
1074 op_id, ctx->opt != nullptr ? "_[?_]" : CelOperator::INDEX,
1075 std::move(target), std::move(index)));
1076}
1077
1078std::any ParserVisitor::visitCreateMessage(
1079 CelParser::CreateMessageContext* ctx) {

Callers

nothing calls this directly

Calls 7

ExprFromAnyFunction · 0.85
SourceRangeFromTokenFunction · 0.85
ExprToAnyFunction · 0.85
memberMethod · 0.80
NextIdMethod · 0.45
ReportErrorMethod · 0.45

Tested by

no test coverage detected