diff options
author | Balajiganapathi S <balajiganapathi.s@gmail.com> | 2017-10-25 16:12:07 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-08-08 18:05:51 +0800 |
commit | 09a36cba0223c16248335703412cee019c7aa59f (patch) | |
tree | ae444498ba2265538c54d4af63742b8bec32da43 /libsolidity/ast | |
parent | 0000bfc604b985c47ab153f4172596b860c7cce8 (diff) | |
download | dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.gz dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.zst dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.zip |
Add stricter hex underscore rules
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 3eccc6d4..73137ba9 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -39,6 +39,7 @@ #include <boost/range/algorithm/copy.hpp> #include <boost/range/adaptor/sliced.hpp> #include <boost/range/adaptor/transformed.hpp> +#include <boost/algorithm/string.hpp> #include <limits> @@ -779,7 +780,9 @@ tuple<bool, rational> RationalNumberType::isValidLiteral(Literal const& _literal if (boost::starts_with(_literal.value(), "0x")) { // process as hex - value = bigint(_literal.value()); + ASTString valueString = _literal.value(); + boost::erase_all(valueString, "_");// Remove underscore separators + value = bigint(valueString); } else if (expPoint != _literal.value().end()) { |