mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4172 from ethereum/trailing_dot
[BREAKING] Disallow trailing dot not followed by number
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user