| 774 | } |
| 775 | |
| 776 | std::any ParserVisitor::visitPrimaryExpr(CelParser::PrimaryExprContext* pctx) { |
| 777 | CelParser::PrimaryContext* primary = pctx->primary(); |
| 778 | if (auto* ctx = tree_as<CelParser::NestedContext>(primary)) { |
| 779 | return visitNested(ctx); |
| 780 | } else if (auto* ctx = tree_as<CelParser::IdentContext>(primary)) { |
| 781 | return visitIdent(ctx); |
| 782 | } else if (auto* ctx = tree_as<CelParser::GlobalCallContext>(primary)) { |
| 783 | return visitGlobalCall(ctx); |
| 784 | } else if (auto* ctx = tree_as<CelParser::CreateListContext>(primary)) { |
| 785 | return visitCreateList(ctx); |
| 786 | } else if (auto* ctx = tree_as<CelParser::CreateMapContext>(primary)) { |
| 787 | return visitCreateMap(ctx); |
| 788 | } else if (auto* ctx = tree_as<CelParser::CreateMessageContext>(primary)) { |
| 789 | return visitCreateMessage(ctx); |
| 790 | } else if (auto* ctx = tree_as<CelParser::ConstantLiteralContext>(primary)) { |
| 791 | return visitConstantLiteral(ctx); |
| 792 | } |
| 793 | if (factory_.HasErrors()) { |
| 794 | // ANTLR creates PrimaryContext rather than a derived class during certain |
| 795 | // error conditions. This is odd, but we ignore it as we already have errors |
| 796 | // that occurred. |
| 797 | return ExprToAny(factory_.NewUnspecified(factory_.NextId({}))); |
| 798 | } |
| 799 | return ExprToAny(factory_.ReportError(SourceRangeFromParserRuleContext(pctx), |
| 800 | "invalid primary expression")); |
| 801 | } |
| 802 | |
| 803 | std::any ParserVisitor::visitMemberExpr(CelParser::MemberExprContext* mctx) { |
| 804 | CelParser::MemberContext* member = mctx->member(); |
nothing calls this directly
no test coverage detected