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

Method extract

liblangutil/SourceReferenceExtractor.cpp:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using namespace solidity::langutil;
29
30SourceReferenceExtractor::Message SourceReferenceExtractor::extract(
31 CharStreamProvider const& _charStreamProvider,
32 util::Exception const& _exception,
33 std::variant<Error::Type, Error::Severity> _typeOrSeverity
34)
35{
36 SourceLocation const* location = boost::get_error_info<errinfo_sourceLocation>(_exception);
37
38 std::string const* message = boost::get_error_info<util::errinfo_comment>(_exception);
39 SourceReference primary = extract(_charStreamProvider, location, message ? *message : "");
40
41 std::vector<SourceReference> secondary;
42 auto secondaryLocation = boost::get_error_info<errinfo_secondarySourceLocation>(_exception);
43 if (secondaryLocation && !secondaryLocation->infos.empty())
44 for (auto const& info: secondaryLocation->infos)
45 secondary.emplace_back(extract(_charStreamProvider, &info.second, info.first));
46
47 return Message{std::move(primary), _typeOrSeverity, std::move(secondary), std::nullopt};
48}
49
50SourceReferenceExtractor::Message SourceReferenceExtractor::extract(
51 CharStreamProvider const& _charStreamProvider,

Callers 1

findLoopMethod · 0.80

Calls 6

errorIdMethod · 0.80
hasTextMethod · 0.80
lineAtPositionMethod · 0.80
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected