| 113 | } |
| 114 | |
| 115 | std::unique_ptr<AST> Parser::parseInline(std::shared_ptr<Scanner> const& _scanner) |
| 116 | { |
| 117 | m_recursionDepth = 0; |
| 118 | |
| 119 | auto previousScannerKind = _scanner->scannerKind(); |
| 120 | _scanner->setScannerMode(ScannerKind::Yul); |
| 121 | ScopeGuard resetScanner([&]{ _scanner->setScannerMode(previousScannerKind); }); |
| 122 | |
| 123 | try |
| 124 | { |
| 125 | m_scanner = _scanner; |
| 126 | if (m_useSourceLocationFrom == UseSourceLocationFrom::Comments) |
| 127 | fetchDebugDataFromComment(); |
| 128 | return std::make_unique<AST>(m_dialect, parseBlock()); |
| 129 | } |
| 130 | catch (FatalError const&) |
| 131 | { |
| 132 | if (!m_errorReporter.hasErrors()) |
| 133 | { |
| 134 | std::cerr << "Unreported fatal error:" << std::endl; |
| 135 | std::cerr << boost::current_exception_diagnostic_information() << std::endl; |
| 136 | yulAssert(false, "Unreported fatal error."); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | return nullptr; |
| 141 | } |
| 142 | |
| 143 | langutil::Token Parser::advance() |
| 144 | { |
no test coverage detected