diff options
author | Christian <c@ethdev.com> | 2014-10-16 23:57:27 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-10-23 22:27:51 +0800 |
commit | a09e4c559d5631a0661b34d0f260612eac0c6e81 (patch) | |
tree | 7cb32617b4bfab8496ffd1dbe8478290b1ff49ed /Types.cpp | |
parent | fd046d7c9088498fbb0bded6a8ca69554155f483 (diff) | |
download | dexon-solidity-a09e4c559d5631a0661b34d0f260612eac0c6e81.tar.gz dexon-solidity-a09e4c559d5631a0661b34d0f260612eac0c6e81.tar.zst dexon-solidity-a09e4c559d5631a0661b34d0f260612eac0c6e81.zip |
Type information for AST printer.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -22,6 +22,7 @@ #include <libsolidity/Types.h> #include <libsolidity/AST.h> +#include <libdevcore/CommonIO.h> namespace dev { @@ -130,6 +131,14 @@ bool IntegerType::acceptsUnaryOperator(Token::Value _operator) const return _operator == Token::DELETE || (!isAddress() && _operator == Token::BIT_NOT); } +std::string IntegerType::toString() const +{ + if (isAddress()) + return "address"; + std::string prefix = isHash() ? "hash" : (isSigned() ? "int" : "uint"); + return prefix + dev::toString(m_bits); +} + bool BoolType::isExplicitlyConvertibleTo(Type const& _convertTo) const { // conversion to integer is fine, but not to address |