MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Primary

Method Primary

parser/gen/cel_parser.go:3392–3810  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3390}
3391
3392func (p *CELParser) Primary() (localctx IPrimaryContext) {
3393 localctx = NewPrimaryContext(p, p.GetParserRuleContext(), p.GetState())
3394 p.EnterRule(localctx, 16, CELParserRULE_primary)
3395 var _la int
3396
3397 p.SetState(184)
3398 p.GetErrorHandler().Sync(p)
3399 if p.HasError() {
3400 goto errorExit
3401 }
3402
3403 switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) {
3404 case 1:
3405 localctx = NewIdentContext(p, localctx)
3406 p.EnterOuterAlt(localctx, 1)
3407 p.SetState(132)
3408 p.GetErrorHandler().Sync(p)
3409 if p.HasError() {
3410 goto errorExit
3411 }
3412 _la = p.GetTokenStream().LA(1)
3413
3414 if _la == CELParserDOT {
3415 {
3416 p.SetState(131)
3417
3418 var _m = p.Match(CELParserDOT)
3419
3420 localctx.(*IdentContext).leadingDot = _m
3421 if p.HasError() {
3422 // Recognition error - abort rule
3423 goto errorExit
3424 }
3425 }
3426
3427 }
3428 {
3429 p.SetState(134)
3430
3431 var _m = p.Match(CELParserIDENTIFIER)
3432
3433 localctx.(*IdentContext).id = _m
3434 if p.HasError() {
3435 // Recognition error - abort rule
3436 goto errorExit
3437 }
3438 }
3439
3440 case 2:
3441 localctx = NewGlobalCallContext(p, localctx)
3442 p.EnterOuterAlt(localctx, 2)
3443 p.SetState(136)
3444 p.GetErrorHandler().Sync(p)
3445 if p.HasError() {
3446 goto errorExit
3447 }
3448 _la = p.GetTokenStream().LA(1)
3449

Callers 2

memberMethod · 0.95
unnestFunction · 0.45

Calls 15

ExprListMethod · 0.95
ExprMethod · 0.95
ListInitMethod · 0.95
MapInitializerListMethod · 0.95
FieldInitializerListMethod · 0.95
LiteralMethod · 0.95
LAMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
NewPrimaryContextFunction · 0.70
NewIdentContextFunction · 0.70
NewGlobalCallContextFunction · 0.70

Tested by

no test coverage detected