MCPcopy Create free account
hub / github.com/argotorg/solidity / tryGetSourceLocationMapping

Function tryGetSourceLocationMapping

test/libyul/ObjectParser.cpp:80–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80std::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

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 5

getFunction · 0.85
evmVersionMethod · 0.45
eofVersionMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected