| 1063 | } |
| 1064 | |
| 1065 | std::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 | |
| 1078 | std::any ParserVisitor::visitCreateMessage( |
| 1079 | CelParser::CreateMessageContext* ctx) { |
nothing calls this directly
no test coverage detected