| 1004 | } |
| 1005 | |
| 1006 | std::string ParserVisitor::NormalizeIdentifier( |
| 1007 | CelParser::EscapeIdentContext* ctx) { |
| 1008 | if (auto* raw_id = tree_as<CelParser::SimpleIdentifierContext>(ctx); raw_id) { |
| 1009 | return raw_id->id->getText(); |
| 1010 | } |
| 1011 | if (auto* escaped_id = tree_as<CelParser::EscapedIdentifierContext>(ctx); |
| 1012 | escaped_id) { |
| 1013 | if (!enable_quoted_identifiers_) { |
| 1014 | factory_.ReportError(SourceRangeFromParserRuleContext(ctx), |
| 1015 | "unsupported syntax '`'"); |
| 1016 | } |
| 1017 | auto escaped_id_text = escaped_id->id->getText(); |
| 1018 | return escaped_id_text.substr(1, escaped_id_text.size() - 2); |
| 1019 | } |
| 1020 | |
| 1021 | // Fallthrough might occur if the parser is in an error state. |
| 1022 | return ""; |
| 1023 | } |
| 1024 | |
| 1025 | std::any ParserVisitor::visitSelect(CelParser::SelectContext* ctx) { |
| 1026 | auto operand = ExprFromAny(visit(ctx->member())); |
nothing calls this directly
no test coverage detected