Visit a parse tree produced by CELParser#Ident.
(ctx *gen.IdentContext)
| 674 | |
| 675 | // Visit a parse tree produced by CELParser#Ident. |
| 676 | func (p *parser) VisitIdent(ctx *gen.IdentContext) any { |
| 677 | identName := "" |
| 678 | if ctx.GetLeadingDot() != nil { |
| 679 | identName = "." |
| 680 | } |
| 681 | // Handle the error case where no valid identifier is specified. |
| 682 | if ctx.GetId() == nil { |
| 683 | return p.helper.newExpr(ctx) |
| 684 | } |
| 685 | // Handle reserved identifiers. |
| 686 | id := ctx.GetId().GetText() |
| 687 | if _, ok := reservedIds[id]; ok { |
| 688 | return p.reportError(ctx, "reserved identifier: %s", id) |
| 689 | } |
| 690 | identName += id |
| 691 | return p.helper.newIdent(ctx.GetId(), identName) |
| 692 | } |
| 693 | |
| 694 | // Visit a parse tree produced by CELParser#GlobalCallContext. |
| 695 | func (p *parser) VisitGlobalCall(ctx *gen.GlobalCallContext) any { |
no test coverage detected