Improve error checking on number parsing

This commit is contained in:
Thomas Pelletier
2015-12-01 14:38:33 +01:00
parent fa1c2ab68c
commit 6d743bb19f
4 changed files with 56 additions and 3 deletions
+2 -1
View File
@@ -184,6 +184,8 @@ func (l *tomlLexer) lexRvalue() tomlLexStateFn {
return l.lexVoid
}
return l.lexRvalue
case '_':
return l.errorf("cannot start number with underscore")
}
if l.follow("true") {
@@ -550,7 +552,6 @@ func (l *tomlLexer) lexNumber() tomlLexStateFn {
} else if isDigit(next) {
digitSeen = true
} else if next == '_' {
l.pos++
} else {
l.backup()
break