| 78 | } |
| 79 | |
| 80 | std::tuple<std::optional<SourceNameMap>, ErrorList> tryGetSourceLocationMapping(std::string _source) |
| 81 | { |
| 82 | std::vector<std::string> lines; |
| 83 | boost::split(lines, _source, boost::is_any_of("\n")); |
| 84 | std::string source = util::joinHumanReadablePrefixed(lines, "\n///") + "\n{}\n"; |
| 85 | |
| 86 | ErrorList errors; |
| 87 | ErrorReporter reporter(errors); |
| 88 | Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(solidity::test::CommonOptions::get().evmVersion(), |
| 89 | solidity::test::CommonOptions::get().eofVersion()); |
| 90 | ObjectParser objectParser{reporter, dialect}; |
| 91 | CharStream stream(std::move(source), ""); |
| 92 | auto object = objectParser.parse(std::make_shared<Scanner>(stream), false); |
| 93 | BOOST_REQUIRE(object && object->debugData); |
| 94 | return {object->debugData->sourceNames, std::move(errors)}; |
| 95 | } |
| 96 | |
| 97 | } |
| 98 |
no test coverage detected