| 1141 | } |
| 1142 | |
| 1143 | std::any ParserVisitor::visitIdent(CelParser::IdentContext* ctx) { |
| 1144 | std::string ident_name; |
| 1145 | if (ctx->leadingDot) { |
| 1146 | ident_name = "."; |
| 1147 | } |
| 1148 | if (!ctx->id) { |
| 1149 | return ExprToAny(factory_.NewUnspecified( |
| 1150 | factory_.NextId(SourceRangeFromParserRuleContext(ctx)))); |
| 1151 | } |
| 1152 | // check if ID is in reserved identifiers |
| 1153 | if (cel::internal::LexisIsReserved(ctx->id->getText())) { |
| 1154 | return ExprToAny(factory_.ReportError( |
| 1155 | SourceRangeFromParserRuleContext(ctx), |
| 1156 | absl::StrFormat("reserved identifier: %s", ctx->id->getText()))); |
| 1157 | } |
| 1158 | |
| 1159 | ident_name += ctx->id->getText(); |
| 1160 | |
| 1161 | return ExprToAny(factory_.NewIdent( |
| 1162 | factory_.NextId(SourceRangeFromToken(ctx->id)), std::move(ident_name))); |
| 1163 | } |
| 1164 | |
| 1165 | std::any ParserVisitor::visitGlobalCall(CelParser::GlobalCallContext* ctx) { |
| 1166 | std::string ident_name; |
nothing calls this directly
no test coverage detected