mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rename Types::identifier to Types::richIdentifier
This commit is contained in:
+25
-19
@@ -163,7 +163,13 @@ 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;
|
||||
/// Can contain characters which are invalid in identifiers.
|
||||
virtual std::string richIdentifier() const = 0;
|
||||
/// @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_".
|
||||
/// Will not contain any character which would be invalid as an identifier.
|
||||
std::string identifier() const { return escapeIdentifier(richIdentifier()); }
|
||||
|
||||
/// More complex identifier strings use "parentheses", where $_ is interpreted as as
|
||||
/// "opening parenthesis", _$ as "closing parenthesis", _$_ as "comma" and any $ that
|
||||
@@ -312,7 +318,7 @@ public:
|
||||
|
||||
explicit IntegerType(int _bits, Modifier _modifier = Modifier::Unsigned);
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
@@ -359,7 +365,7 @@ public:
|
||||
|
||||
explicit FixedPointType(int _totalBits, int _fractionalDigits, Modifier _modifier = Modifier::Unsigned);
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
@@ -416,7 +422,7 @@ public:
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
virtual TypePointer binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const override;
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
|
||||
virtual bool canBeStored() const override { return false; }
|
||||
@@ -465,7 +471,7 @@ public:
|
||||
return TypePointer();
|
||||
}
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
|
||||
virtual bool canBeStored() const override { return false; }
|
||||
@@ -499,7 +505,7 @@ public:
|
||||
|
||||
virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
virtual TypePointer binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const override;
|
||||
@@ -527,7 +533,7 @@ class BoolType: public Type
|
||||
public:
|
||||
BoolType() {}
|
||||
virtual Category category() const override { return Category::Bool; }
|
||||
virtual std::string identifier() const override { return "t_bool"; }
|
||||
virtual std::string richIdentifier() const override { return "t_bool"; }
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
virtual TypePointer binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const override;
|
||||
|
||||
@@ -627,7 +633,7 @@ public:
|
||||
|
||||
virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(const Type& _other) const override;
|
||||
virtual unsigned calldataEncodedSize(bool _padded) const override;
|
||||
virtual bool isDynamicallySized() const override { return m_hasDynamicLength; }
|
||||
@@ -684,7 +690,7 @@ public:
|
||||
/// Contracts can be converted to themselves and to integers.
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual unsigned calldataEncodedSize(bool _padded ) const override
|
||||
{
|
||||
@@ -742,7 +748,7 @@ public:
|
||||
explicit StructType(StructDefinition const& _struct, DataLocation _location = DataLocation::Storage):
|
||||
ReferenceType(_location), m_struct(_struct) {}
|
||||
virtual bool isImplicitlyConvertibleTo(const Type& _convertTo) const override;
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual unsigned calldataEncodedSize(bool _padded) const override;
|
||||
virtual bool isDynamicallyEncoded() const override;
|
||||
@@ -797,7 +803,7 @@ public:
|
||||
virtual Category category() const override { return Category::Enum; }
|
||||
explicit EnumType(EnumDefinition const& _enum): m_enum(_enum) {}
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual unsigned calldataEncodedSize(bool _padded) const override
|
||||
{
|
||||
@@ -838,7 +844,7 @@ public:
|
||||
virtual Category category() const override { return Category::Tuple; }
|
||||
explicit TupleType(std::vector<TypePointer> const& _types = std::vector<TypePointer>()): m_components(_types) {}
|
||||
virtual bool isImplicitlyConvertibleTo(Type const& _other) const override;
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual TypePointer binaryOperatorResult(Token::Value, TypePointer const&) const override { return TypePointer(); }
|
||||
virtual std::string toString(bool) const override;
|
||||
@@ -972,7 +978,7 @@ public:
|
||||
/// @returns the "self" parameter type for a bound function
|
||||
TypePointer const& selfType() const;
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
|
||||
@@ -1076,7 +1082,7 @@ public:
|
||||
MappingType(TypePointer const& _keyType, TypePointer const& _valueType):
|
||||
m_keyType(_keyType), m_valueType(_valueType) {}
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual std::string toString(bool _short) const override;
|
||||
virtual std::string canonicalName() const override;
|
||||
@@ -1113,7 +1119,7 @@ public:
|
||||
TypePointer const& actualType() const { return m_actualType; }
|
||||
|
||||
virtual TypePointer binaryOperatorResult(Token::Value, TypePointer const&) const override { return TypePointer(); }
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual bool canBeStored() const override { return false; }
|
||||
virtual u256 storageSize() const override;
|
||||
@@ -1141,7 +1147,7 @@ public:
|
||||
virtual u256 storageSize() const override;
|
||||
virtual bool canLiveOutsideStorage() const override { return false; }
|
||||
virtual unsigned sizeOnStack() const override { return 0; }
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual std::string toString(bool _short) const override;
|
||||
|
||||
@@ -1162,7 +1168,7 @@ public:
|
||||
explicit ModuleType(SourceUnit const& _source): m_sourceUnit(_source) {}
|
||||
|
||||
virtual TypePointer binaryOperatorResult(Token::Value, TypePointer const&) const override { return TypePointer(); }
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual bool canBeStored() const override { return false; }
|
||||
virtual bool canLiveOutsideStorage() const override { return true; }
|
||||
@@ -1192,7 +1198,7 @@ public:
|
||||
return TypePointer();
|
||||
}
|
||||
|
||||
virtual std::string identifier() const override;
|
||||
virtual std::string richIdentifier() const override;
|
||||
virtual bool operator==(Type const& _other) const override;
|
||||
virtual bool canBeStored() const override { return false; }
|
||||
virtual bool canLiveOutsideStorage() const override { return true; }
|
||||
@@ -1216,7 +1222,7 @@ class InaccessibleDynamicType: public Type
|
||||
public:
|
||||
virtual Category category() const override { return Category::InaccessibleDynamic; }
|
||||
|
||||
virtual std::string identifier() const override { return "t_inaccessible"; }
|
||||
virtual std::string richIdentifier() const override { return "t_inaccessible"; }
|
||||
virtual bool isImplicitlyConvertibleTo(Type const&) const override { return false; }
|
||||
virtual bool isExplicitlyConvertibleTo(Type const&) const override { return false; }
|
||||
virtual TypePointer binaryOperatorResult(Token::Value, TypePointer const&) const override { return TypePointer(); }
|
||||
|
||||
Reference in New Issue
Block a user