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

Method Literal

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

Source from the content-addressed store, hash-verified

5939}
5940
5941func (p *CELParser) Literal() (localctx ILiteralContext) {
5942 localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
5943 p.EnterRule(localctx, 32, CELParserRULE_literal)
5944 var _la int
5945
5946 p.SetState(256)
5947 p.GetErrorHandler().Sync(p)
5948 if p.HasError() {
5949 goto errorExit
5950 }
5951
5952 switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 35, p.GetParserRuleContext()) {
5953 case 1:
5954 localctx = NewIntContext(p, localctx)
5955 p.EnterOuterAlt(localctx, 1)
5956 p.SetState(243)
5957 p.GetErrorHandler().Sync(p)
5958 if p.HasError() {
5959 goto errorExit
5960 }
5961 _la = p.GetTokenStream().LA(1)
5962
5963 if _la == CELParserMINUS {
5964 {
5965 p.SetState(242)
5966
5967 var _m = p.Match(CELParserMINUS)
5968
5969 localctx.(*IntContext).sign = _m
5970 if p.HasError() {
5971 // Recognition error - abort rule
5972 goto errorExit
5973 }
5974 }
5975
5976 }
5977 {
5978 p.SetState(245)
5979
5980 var _m = p.Match(CELParserNUM_INT)
5981
5982 localctx.(*IntContext).tok = _m
5983 if p.HasError() {
5984 // Recognition error - abort rule
5985 goto errorExit
5986 }
5987 }
5988
5989 case 2:
5990 localctx = NewUintContext(p, localctx)
5991 p.EnterOuterAlt(localctx, 2)
5992 {
5993 p.SetState(246)
5994
5995 var _m = p.Match(CELParserNUM_UINT)
5996
5997 localctx.(*UintContext).tok = _m
5998 if p.HasError() {

Callers 2

PrimaryMethod · 0.95
unnestFunction · 0.45

Calls 15

LAMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
NewLiteralContextFunction · 0.70
NewIntContextFunction · 0.70
NewUintContextFunction · 0.70
NewDoubleContextFunction · 0.70
NewStringContextFunction · 0.70
NewBytesContextFunction · 0.70
NewBoolTrueContextFunction · 0.70
NewBoolFalseContextFunction · 0.70
NewNullContextFunction · 0.70

Tested by

no test coverage detected