aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-03-12 00:42:55 +0800
committerchriseth <c@ethdev.com>2016-03-12 00:50:09 +0800
commit9b00290d74790bb7204449bc96a0ac3660581912 (patch)
tree4c46c6a1651841265b65239dd4847d802892b71f /libsolidity/parsing
parent299fef0c797c045888af5241334247390169bef1 (diff)
downloaddexon-solidity-9b00290d74790bb7204449bc96a0ac3660581912.tar.gz
dexon-solidity-9b00290d74790bb7204449bc96a0ac3660581912.tar.zst
dexon-solidity-9b00290d74790bb7204449bc96a0ac3660581912.zip
Remove timestamp again and some fixes for ufixed parsing.
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r--libsolidity/parsing/Token.cpp32
-rw-r--r--libsolidity/parsing/Token.h1
2 files changed, 18 insertions, 15 deletions
diff --git a/libsolidity/parsing/Token.cpp b/libsolidity/parsing/Token.cpp
index 158ce516..3812a83f 100644
--- a/libsolidity/parsing/Token.cpp
+++ b/libsolidity/parsing/Token.cpp
@@ -147,21 +147,25 @@ tuple<Token::Value, unsigned int, unsigned int> Token::fromIdentifierOrKeyword(s
}
else if (keyword == Token::UFixed || keyword == Token::Fixed)
{
- auto positionN = find_if_not(++positionX, _literal.end(), ::isdigit);
- int n = parseSize(++positionX, positionN);
if (
- 0 < m + n &&
- m + n <= 256 &&
- m % 8 == 0 &&
- n % 8 == 0 &&
- positionN == _literal.end() &&
- *positionX == 'x'
- )
- {
- if (keyword == Token::UFixed)
- return make_tuple(Token::UFixed, m, n);
- else
- return make_tuple(Token::Fixed, m, n);
+ positionM < positionX &&
+ positionX < _literal.end() &&
+ *positionX == 'x' &&
+ all_of(positionX + 1, _literal.end(), ::isdigit)
+ ) {
+ int n = parseSize(positionX + 1, _literal.end());
+ if (
+ 0 < m && m < 256 &&
+ 0 < n && n < 256 &&
+ m + n <= 256 &&
+ m % 8 == 0 &&
+ 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);
diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h
index b8ad7471..31646f8d 100644
--- a/libsolidity/parsing/Token.h
+++ b/libsolidity/parsing/Token.h
@@ -231,7 +231,6 @@ namespace solidity
K(Type, "type", 0) \
K(TypeOf, "typeof", 0) \
K(Using, "using", 0) \
- T(Timestamp, "timestamp", 0) \
/* Illegal token - not able to scan. */ \
T(Illegal, "ILLEGAL", 0) \
\