mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change fixed point types to have digit count
Signed-off-by: VoR0220 <rj@erisindustries.com>
This commit is contained in:
committed by
Alex Beregszaszi
parent
6d6d4f6907
commit
78769f3b39
@@ -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::Value, unsigned int, unsigned int> 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);
|
||||
|
||||
Reference in New Issue
Block a user