mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove timestamp again and some fixes for ufixed parsing.
This commit is contained in:
parent
299fef0c79
commit
9b00290d74
@ -147,21 +147,25 @@ tuple<Token::Value, unsigned int, unsigned int> Token::fromIdentifierOrKeyword(s
|
|||||||
}
|
}
|
||||||
else if (keyword == Token::UFixed || keyword == Token::Fixed)
|
else if (keyword == Token::UFixed || keyword == Token::Fixed)
|
||||||
{
|
{
|
||||||
auto positionN = find_if_not(++positionX, _literal.end(), ::isdigit);
|
|
||||||
int n = parseSize(++positionX, positionN);
|
|
||||||
if (
|
if (
|
||||||
0 < m + n &&
|
positionM < positionX &&
|
||||||
m + n <= 256 &&
|
positionX < _literal.end() &&
|
||||||
m % 8 == 0 &&
|
*positionX == 'x' &&
|
||||||
n % 8 == 0 &&
|
all_of(positionX + 1, _literal.end(), ::isdigit)
|
||||||
positionN == _literal.end() &&
|
) {
|
||||||
*positionX == 'x'
|
int n = parseSize(positionX + 1, _literal.end());
|
||||||
)
|
if (
|
||||||
{
|
0 < m && m < 256 &&
|
||||||
if (keyword == Token::UFixed)
|
0 < n && n < 256 &&
|
||||||
return make_tuple(Token::UFixed, m, n);
|
m + n <= 256 &&
|
||||||
else
|
m % 8 == 0 &&
|
||||||
return make_tuple(Token::Fixed, m, n);
|
n % 8 == 0
|
||||||
|
) {
|
||||||
|
if (keyword == Token::UFixed)
|
||||||
|
return make_tuple(Token::UFixed, m, n);
|
||||||
|
else
|
||||||
|
return make_tuple(Token::Fixed, m, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return make_tuple(Token::Identifier, 0, 0);
|
return make_tuple(Token::Identifier, 0, 0);
|
||||||
|
@ -231,7 +231,6 @@ namespace solidity
|
|||||||
K(Type, "type", 0) \
|
K(Type, "type", 0) \
|
||||||
K(TypeOf, "typeof", 0) \
|
K(TypeOf, "typeof", 0) \
|
||||||
K(Using, "using", 0) \
|
K(Using, "using", 0) \
|
||||||
T(Timestamp, "timestamp", 0) \
|
|
||||||
/* Illegal token - not able to scan. */ \
|
/* Illegal token - not able to scan. */ \
|
||||||
T(Illegal, "ILLEGAL", 0) \
|
T(Illegal, "ILLEGAL", 0) \
|
||||||
\
|
\
|
||||||
|
Loading…
Reference in New Issue
Block a user