mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add helpers escapeIdentifier to Types
This commit is contained in:
@@ -163,10 +163,16 @@ public:
|
||||
/// @returns a valid solidity identifier such that two types should compare equal if and
|
||||
/// only if they have the same identifier.
|
||||
/// The identifier should start with "t_".
|
||||
virtual std::string identifier() const = 0;
|
||||
|
||||
/// More complex identifier strings use "parentheses", where $_ is interpreted as as
|
||||
/// "opening parenthesis", _$ as "closing parenthesis", _$_ as "comma" and any $ that
|
||||
/// appears as part of a user-supplied identifier is escaped as _$$$_.
|
||||
virtual std::string identifier() const = 0;
|
||||
/// @returns an escaped identifier (will not contain any parenthesis or commas)
|
||||
static std::string escapeIdentifier(std::string const& _identifier);
|
||||
/// @returns an unescaped identifier
|
||||
static std::string unescapeIdentifier(std::string const& _identifier);
|
||||
|
||||
virtual bool isImplicitlyConvertibleTo(Type const& _other) const { return *this == _other; }
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user