diff options
Diffstat (limited to 'libsolidity/parsing/Scanner.cpp')
-rw-r--r-- | libsolidity/parsing/Scanner.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libsolidity/parsing/Scanner.cpp b/libsolidity/parsing/Scanner.cpp index 6541f6c2..801d2cc4 100644 --- a/libsolidity/parsing/Scanner.cpp +++ b/libsolidity/parsing/Scanner.cpp @@ -768,8 +768,14 @@ Token::Value Scanner::scanNumber(char _charSeen) scanDecimalDigits(); // optional if (m_char == '.') { + // A '.' has to be followed by a number. + if (m_source.isPastEndOfInput() || !isDecimalDigit(m_source.get(1))) + { + literal.complete(); + return Token::Number; + } addLiteralCharAndAdvance(); - scanDecimalDigits(); // optional + scanDecimalDigits(); } } } |