From 78769f3b39bccbfa02edec302a02377e8fa08a8d Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Thu, 22 Dec 2016 12:20:03 -0600 Subject: Change fixed point types to have digit count Signed-off-by: VoR0220 --- libsolidity/parsing/Token.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libsolidity/parsing') diff --git a/libsolidity/parsing/Token.cpp b/libsolidity/parsing/Token.cpp index 66312f69..d290bedb 100644 --- a/libsolidity/parsing/Token.cpp +++ b/libsolidity/parsing/Token.cpp @@ -70,7 +70,7 @@ void ElementaryTypeNameToken::assertDetails(Token::Value _baseType, unsigned con else if (_baseType == Token::UFixedMxN || _baseType == Token::FixedMxN) { solAssert( - _first + _second <= 256 && _first % 8 == 0 && _second % 8 == 0, + _first <= 256 && _first % 8 == 0 && _second >= 0 && _second <= 80, "No elementary type " + string(Token::toString(_baseType)) + to_string(_first) + "x" + to_string(_second) + "." ); } @@ -157,12 +157,8 @@ tuple Token::fromIdentifierOrKeyword(s ) { int n = parseSize(positionX + 1, _literal.end()); if ( - 0 <= m && m <= 256 && - 8 <= n && n <= 256 && - m + n > 0 && - m + n <= 256 && - m % 8 == 0 && - n % 8 == 0 + 8 <= m && m <= 256 && m % 8 == 0 && + 0 <= n && n <= 80 ) { if (keyword == Token::UFixed) return make_tuple(Token::UFixedMxN, m, n); -- cgit