Add util::capitalized() and Type::categoryName()

This commit is contained in:
Kamil Śliwak
2023-04-04 17:30:37 +02:00
parent 7b634152bd
commit 293690e5a4
3 changed files with 60 additions and 3 deletions
+22 -3
View File
@@ -174,9 +174,26 @@ public:
enum class Category
{
Address, Integer, RationalNumber, StringLiteral, Bool, FixedPoint, Array, ArraySlice,
FixedBytes, Contract, Struct, Function, Enum, UserDefinedValueType, Tuple,
Mapping, TypeType, Modifier, Magic, Module,
Address,
Integer,
RationalNumber,
StringLiteral,
Bool,
FixedPoint,
Array,
ArraySlice,
FixedBytes,
Contract,
Struct,
Function,
Enum,
UserDefinedValueType,
Tuple,
Mapping,
TypeType,
Modifier,
Magic,
Module,
InaccessibleDynamic
};
@@ -184,6 +201,8 @@ public:
static Type const* commonType(Type const* _a, Type const* _b);
virtual Category category() const = 0;
static char const* categoryName(Type::Category _category);
/// @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_".