()
| 3273 | } |
| 3274 | |
| 3275 | func (p *GScriptParser) VariableInitializer() (localctx IVariableInitializerContext) { |
| 3276 | localctx = NewVariableInitializerContext(p, p.GetParserRuleContext(), p.GetState()) |
| 3277 | p.EnterRule(localctx, 38, GScriptParserRULE_variableInitializer) |
| 3278 | |
| 3279 | defer func() { |
| 3280 | p.ExitRule() |
| 3281 | }() |
| 3282 | |
| 3283 | defer func() { |
| 3284 | if err := recover(); err != nil { |
| 3285 | if v, ok := err.(antlr.RecognitionException); ok { |
| 3286 | localctx.SetException(v) |
| 3287 | p.GetErrorHandler().ReportError(p, v) |
| 3288 | p.GetErrorHandler().Recover(p, v) |
| 3289 | } else { |
| 3290 | panic(err) |
| 3291 | } |
| 3292 | } |
| 3293 | }() |
| 3294 | |
| 3295 | p.SetState(231) |
| 3296 | p.GetErrorHandler().Sync(p) |
| 3297 | |
| 3298 | switch p.GetTokenStream().LA(1) { |
| 3299 | case GScriptParserLBRACE, GScriptParserLBRACK: |
| 3300 | p.EnterOuterAlt(localctx, 1) |
| 3301 | { |
| 3302 | p.SetState(229) |
| 3303 | p.ArrayInitializer() |
| 3304 | } |
| 3305 | |
| 3306 | case GScriptParserSUPER, GScriptParserTHIS, GScriptParserNil, GScriptParserLPAREN, GScriptParserBANG, GScriptParserTILDE, GScriptParserPLUS, GScriptParserSUB, GScriptParserBOOL_LITERAL, GScriptParserSTRING_LITERAL, GScriptParserRAW_STRING_LIT, GScriptParserNULL_LITERAL, GScriptParserDECIMAL_LITERAL, GScriptParserFLOAT_LITERAL, GScriptParserIDENTIFIER: |
| 3307 | p.EnterOuterAlt(localctx, 2) |
| 3308 | { |
| 3309 | p.SetState(230) |
| 3310 | p.expr(0) |
| 3311 | } |
| 3312 | |
| 3313 | default: |
| 3314 | panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) |
| 3315 | } |
| 3316 | |
| 3317 | return localctx |
| 3318 | } |
| 3319 | |
| 3320 | // IArrayInitializerContext is an interface to support dynamic dispatch. |
| 3321 | type IArrayInitializerContext interface { |
no test coverage detected