Don't allow floats starting with a dot
This commit is contained in:
@@ -234,6 +234,10 @@ func lexRvalue(l *lexer) stateFn {
|
||||
return lexNumber
|
||||
}
|
||||
|
||||
if next == '.' {
|
||||
return l.errorf("cannot start float with a dot")
|
||||
}
|
||||
|
||||
if isSpace(next) {
|
||||
l.ignore()
|
||||
}
|
||||
@@ -416,6 +420,9 @@ func lexNumber(l *lexer) stateFn {
|
||||
l.backup()
|
||||
break
|
||||
}
|
||||
if point_seen && !digit_seen {
|
||||
return l.errorf("cannot start float with a dot")
|
||||
}
|
||||
}
|
||||
|
||||
if !digit_seen {
|
||||
|
||||
Reference in New Issue
Block a user