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

Method Literal

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

Source from the content-addressed store, hash-verified

9897}
9898
9899func (p *CommandsParser) Literal() (localctx ILiteralContext) {
9900 localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
9901 p.EnterRule(localctx, 72, CommandsParserRULE_literal)
9902 var _la int
9903
9904 p.SetState(436)
9905 p.GetErrorHandler().Sync(p)
9906 if p.HasError() {
9907 goto errorExit
9908 }
9909
9910 switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 55, p.GetParserRuleContext()) {
9911 case 1:
9912 localctx = NewIntContext(p, localctx)
9913 p.EnterOuterAlt(localctx, 1)
9914 p.SetState(423)
9915 p.GetErrorHandler().Sync(p)
9916 if p.HasError() {
9917 goto errorExit
9918 }
9919 _la = p.GetTokenStream().LA(1)
9920
9921 if _la == CommandsParserMINUS {
9922 {
9923 p.SetState(422)
9924
9925 var _m = p.Match(CommandsParserMINUS)
9926
9927 localctx.(*IntContext).sign = _m
9928 if p.HasError() {
9929 // Recognition error - abort rule
9930 goto errorExit
9931 }
9932 }
9933
9934 }
9935 {
9936 p.SetState(425)
9937
9938 var _m = p.Match(CommandsParserNUM_INT)
9939
9940 localctx.(*IntContext).tok = _m
9941 if p.HasError() {
9942 // Recognition error - abort rule
9943 goto errorExit
9944 }
9945 }
9946
9947 case 2:
9948 localctx = NewUintContext(p, localctx)
9949 p.EnterOuterAlt(localctx, 2)
9950 {
9951 p.SetState(426)
9952
9953 var _m = p.Match(CommandsParserNUM_UINT)
9954
9955 localctx.(*UintContext).tok = _m
9956 if p.HasError() {

Callers 1

PrimaryMethod · 0.95

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