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

Method Let

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

Source from the content-addressed store, hash-verified

1108}
1109
1110func (p *CommandsParser) Let() (localctx ILetContext) {
1111 localctx = NewLetContext(p, p.GetParserRuleContext(), p.GetState())
1112 p.EnterRule(localctx, 6, CommandsParserRULE_let)
1113 p.EnterOuterAlt(localctx, 1)
1114 {
1115 p.SetState(90)
1116 p.Match(CommandsParserT__2)
1117 if p.HasError() {
1118 // Recognition error - abort rule
1119 goto errorExit
1120 }
1121 }
1122 p.SetState(97)
1123 p.GetErrorHandler().Sync(p)
1124 if p.HasError() {
1125 goto errorExit
1126 }
1127
1128 switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 1, p.GetParserRuleContext()) {
1129 case 1:
1130 {
1131 p.SetState(91)
1132
1133 var _x = p.VarDecl()
1134
1135 localctx.(*LetContext).var_ = _x
1136 }
1137 {
1138 p.SetState(92)
1139 p.Match(CommandsParserEQUAL_ASSIGN)
1140 if p.HasError() {
1141 // Recognition error - abort rule
1142 goto errorExit
1143 }
1144 }
1145
1146 case 2:
1147 {
1148 p.SetState(94)
1149
1150 var _x = p.FnDecl()
1151
1152 localctx.(*LetContext).fn = _x
1153 }
1154 {
1155 p.SetState(95)
1156 p.Match(CommandsParserARROW)
1157 if p.HasError() {
1158 // Recognition error - abort rule
1159 goto errorExit
1160 }
1161 }
1162
1163 case antlr.ATNInvalidAltNumber:
1164 goto errorExit
1165 }
1166 {
1167 p.SetState(99)

Callers 1

CommandMethod · 0.95

Calls 10

VarDeclMethod · 0.95
FnDeclMethod · 0.95
ExprMethod · 0.95
NewLetContextFunction · 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