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

Method OptExpr

repl/parser/commands_parser.go:9387–9433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9385}
9386
9387func (p *CommandsParser) OptExpr() (localctx IOptExprContext) {
9388 localctx = NewOptExprContext(p, p.GetParserRuleContext(), p.GetState())
9389 p.EnterRule(localctx, 70, CommandsParserRULE_optExpr)
9390 var _la int
9391
9392 p.EnterOuterAlt(localctx, 1)
9393 p.SetState(418)
9394 p.GetErrorHandler().Sync(p)
9395 if p.HasError() {
9396 goto errorExit
9397 }
9398 _la = p.GetTokenStream().LA(1)
9399
9400 if _la == CommandsParserQUESTIONMARK {
9401 {
9402 p.SetState(417)
9403
9404 var _m = p.Match(CommandsParserQUESTIONMARK)
9405
9406 localctx.(*OptExprContext).opt = _m
9407 if p.HasError() {
9408 // Recognition error - abort rule
9409 goto errorExit
9410 }
9411 }
9412
9413 }
9414 {
9415 p.SetState(420)
9416
9417 var _x = p.Expr()
9418
9419 localctx.(*OptExprContext).e = _x
9420 }
9421
9422errorExit:
9423 if p.HasError() {
9424 v := p.GetError()
9425 localctx.SetException(v)
9426 p.GetErrorHandler().ReportError(p, v)
9427 p.GetErrorHandler().Recover(p, v)
9428 p.SetError(nil)
9429 }
9430 p.ExitRule()
9431 return localctx
9432 goto errorExit // Trick to prevent compiler error if the label is not used
9433}
9434
9435// ILiteralContext is an interface to support dynamic dispatch.
9436type ILiteralContext interface {

Callers 2

ListInitMethod · 0.95
MapInitializerListMethod · 0.95

Calls 9

ExprMethod · 0.95
LAMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
NewOptExprContextFunction · 0.70
GetStateMethod · 0.65
MatchMethod · 0.65
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected