| 62 | } |
| 63 | |
| 64 | LuaParser::ChunkContext* LuaParser::chunk() { |
| 65 | ChunkContext *_localctx = _tracker.createInstance<ChunkContext>(_ctx, getState()); |
| 66 | enterRule(_localctx, 0, LuaParser::RuleChunk); |
| 67 | size_t _la = 0; |
| 68 | |
| 69 | auto onExit = finally([=] { |
| 70 | exitRule(); |
| 71 | }); |
| 72 | try { |
| 73 | enterOuterAlt(_localctx, 1); |
| 74 | setState(83); |
| 75 | _errHandler->sync(this); |
| 76 | |
| 77 | _la = _input->LA(1); |
| 78 | if (_la == LuaParser::SHEBANG) { |
| 79 | setState(82); |
| 80 | match(LuaParser::SHEBANG); |
| 81 | } |
| 82 | setState(85); |
| 83 | block(); |
| 84 | setState(86); |
| 85 | match(LuaParser::EOF); |
| 86 | |
| 87 | } |
| 88 | catch (RecognitionException &e) { |
| 89 | _errHandler->reportError(this, e); |
| 90 | _localctx->exception = std::current_exception(); |
| 91 | _errHandler->recover(this, _localctx->exception); |
| 92 | } |
| 93 | |
| 94 | return _localctx; |
| 95 | } |
| 96 | |
| 97 | //----------------- BlockContext ------------------------------------------------------------------ |
| 98 | |