mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move the function for creating code snippets used next to source locations in assembly to liblangutil
This commit is contained in:
@@ -118,6 +118,15 @@ public:
|
||||
/// Returns an empty string view if the source location does not `hasText()`.
|
||||
std::string_view text(SourceLocation const& _location) const;
|
||||
|
||||
/// @returns the first line of the referenced source fragment. If the fragment is longer than
|
||||
/// one line, appends an ellipsis to indicate that.
|
||||
std::string singleLineSnippet(SourceLocation const& _location) const
|
||||
{
|
||||
return singleLineSnippet(m_source, _location);
|
||||
}
|
||||
|
||||
static std::string singleLineSnippet(std::string const& _sourceCode, SourceLocation const& _location);
|
||||
|
||||
private:
|
||||
std::string m_source;
|
||||
std::string m_name;
|
||||
|
||||
Reference in New Issue
Block a user