| 1163 | } |
| 1164 | |
| 1165 | std::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 | |
| 1189 | std::any ParserVisitor::visitNested(CelParser::NestedContext* ctx) { |
| 1190 | return visit(ctx->e); |
nothing calls this directly
no test coverage detected