mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make ReferenceType::stringForReferencePart() public
This commit is contained in:
parent
56a6613c21
commit
acf943005a
@ -1561,19 +1561,21 @@ Type const* ReferenceType::copyForLocationIfReference(Type const* _type) const
|
||||
return TypeProvider::withLocationIfReference(m_location, _type);
|
||||
}
|
||||
|
||||
string ReferenceType::stringForReferencePart() const
|
||||
string ReferenceType::stringForReferencePart(bool _showIndirection) const
|
||||
{
|
||||
switch (m_location)
|
||||
{
|
||||
case DataLocation::Storage:
|
||||
return string("storage ") + (isPointer() ? "pointer" : "ref");
|
||||
if (_showIndirection)
|
||||
return string("storage ") + (_showIndirection && isPointer() ? "pointer" : "ref");
|
||||
else
|
||||
return string("storage");
|
||||
case DataLocation::CallData:
|
||||
return "calldata";
|
||||
case DataLocation::Memory:
|
||||
return "memory";
|
||||
}
|
||||
solAssert(false, "");
|
||||
return "";
|
||||
solAssert(false);
|
||||
}
|
||||
|
||||
string ReferenceType::identifierLocationSuffix() const
|
||||
|
@ -793,10 +793,12 @@ public:
|
||||
|
||||
Type const* withLocation(DataLocation _location, bool _isPointer) const;
|
||||
|
||||
/// @returns a human-readable description of the reference part of the type.
|
||||
/// @param _showIndirection If true, the description indicates whether it's a pointer or not.
|
||||
std::string stringForReferencePart(bool _showIndirection = true) const;
|
||||
|
||||
protected:
|
||||
Type const* copyForLocationIfReference(Type const* _type) const;
|
||||
/// @returns a human-readable description of the reference part of the type.
|
||||
std::string stringForReferencePart() const;
|
||||
/// @returns the suffix computed from the reference part to be used by identifier();
|
||||
std::string identifierLocationSuffix() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user