aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-04 20:24:35 +0800
committerChristian <c@ethdev.com>2014-11-06 09:22:24 +0800
commitde493c673f2e850505d79185d104012825a7eabc (patch)
tree9496584d066c4454e85a795a053ea0037860785a /Types.h
parente30d3f8d539882376b29a1fe8f4bf6bcaf8c1762 (diff)
downloaddexon-solidity-de493c673f2e850505d79185d104012825a7eabc.tar.gz
dexon-solidity-de493c673f2e850505d79185d104012825a7eabc.tar.zst
dexon-solidity-de493c673f2e850505d79185d104012825a7eabc.zip
Detect integer length from literals and remove "std::".
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Types.h b/Types.h
index 4493b803..8c88ca79 100644
--- a/Types.h
+++ b/Types.h
@@ -56,7 +56,8 @@ public:
static std::shared_ptr<Type> fromMapping(Mapping const& _typeName);
/// @}
- /// Auto-detect the proper type for a literal
+ /// Auto-detect the proper type for a literal. @returns an empty pointer if the literal does
+ /// not fit any type.
static std::shared_ptr<Type> forLiteral(Literal const& _literal);
virtual Category getCategory() const = 0;
@@ -95,6 +96,8 @@ public:
};
virtual Category getCategory() const override { return Category::INTEGER; }
+ /// @returns the smallest integer type for the given literal or an empty pointer
+ /// if no type fits.
static std::shared_ptr<IntegerType> smallestTypeForLiteral(std::string const& _literal);
explicit IntegerType(int _bits, Modifier _modifier = Modifier::UNSIGNED);