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

Method EscapeIdent

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

Source from the content-addressed store, hash-verified

9208}
9209
9210func (p *CommandsParser) EscapeIdent() (localctx IEscapeIdentContext) {
9211 localctx = NewEscapeIdentContext(p, p.GetParserRuleContext(), p.GetState())
9212 p.EnterRule(localctx, 68, CommandsParserRULE_escapeIdent)
9213 p.SetState(415)
9214 p.GetErrorHandler().Sync(p)
9215 if p.HasError() {
9216 goto errorExit
9217 }
9218
9219 switch p.GetTokenStream().LA(1) {
9220 case CommandsParserIDENTIFIER:
9221 localctx = NewSimpleIdentifierContext(p, localctx)
9222 p.EnterOuterAlt(localctx, 1)
9223 {
9224 p.SetState(413)
9225
9226 var _m = p.Match(CommandsParserIDENTIFIER)
9227
9228 localctx.(*SimpleIdentifierContext).id = _m
9229 if p.HasError() {
9230 // Recognition error - abort rule
9231 goto errorExit
9232 }
9233 }
9234
9235 case CommandsParserESC_IDENTIFIER:
9236 localctx = NewEscapedIdentifierContext(p, localctx)
9237 p.EnterOuterAlt(localctx, 2)
9238 {
9239 p.SetState(414)
9240
9241 var _m = p.Match(CommandsParserESC_IDENTIFIER)
9242
9243 localctx.(*EscapedIdentifierContext).id = _m
9244 if p.HasError() {
9245 // Recognition error - abort rule
9246 goto errorExit
9247 }
9248 }
9249
9250 default:
9251 p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
9252 goto errorExit
9253 }
9254
9255errorExit:
9256 if p.HasError() {
9257 v := p.GetError()
9258 localctx.SetException(v)
9259 p.GetErrorHandler().ReportError(p, v)
9260 p.GetErrorHandler().Recover(p, v)
9261 p.SetError(nil)
9262 }
9263 p.ExitRule()
9264 return localctx
9265 goto errorExit // Trick to prevent compiler error if the label is not used
9266}
9267

Callers 2

memberMethod · 0.95
OptFieldMethod · 0.95

Calls 10

LAMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
NewEscapeIdentContextFunction · 0.70
GetStateMethod · 0.65
MatchMethod · 0.65
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected