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

Method Compile

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

Source from the content-addressed store, hash-verified

2662}
2663
2664func (p *CommandsParser) Compile() (localctx ICompileContext) {
2665 localctx = NewCompileContext(p, p.GetParserRuleContext(), p.GetState())
2666 p.EnterRule(localctx, 22, CommandsParserRULE_compile)
2667 p.EnterOuterAlt(localctx, 1)
2668 {
2669 p.SetState(146)
2670 p.Match(CommandsParserT__5)
2671 if p.HasError() {
2672 // Recognition error - abort rule
2673 goto errorExit
2674 }
2675 }
2676 {
2677 p.SetState(147)
2678
2679 var _x = p.Expr()
2680
2681 localctx.(*CompileContext).e = _x
2682 }
2683
2684errorExit:
2685 if p.HasError() {
2686 v := p.GetError()
2687 localctx.SetException(v)
2688 p.GetErrorHandler().ReportError(p, v)
2689 p.GetErrorHandler().Recover(p, v)
2690 p.SetError(nil)
2691 }
2692 p.ExitRule()
2693 return localctx
2694 goto errorExit // Trick to prevent compiler error if the label is not used
2695}
2696
2697// IParseContext is an interface to support dynamic dispatch.
2698type IParseContext interface {

Callers 1

CommandMethod · 0.95

Calls 8

ExprMethod · 0.95
NewCompileContextFunction · 0.85
ReportErrorMethod · 0.80
RecoverMethod · 0.80
GetStateMethod · 0.65
MatchMethod · 0.65
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected