mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
toml: fix float checker bug for -0.01
(#12590)
This commit is contained in:
parent
d52b62a4f4
commit
22043f2df1
@ -118,8 +118,7 @@ fn (c Checker) check_number(num ast.Number) ? {
|
||||
return error(@MOD + '.' + @STRUCT + '.' + @FN +
|
||||
' numbers like "$lit" (hex, octal and binary) can not start with `$ascii` in ...${c.excerpt(num.pos)}...')
|
||||
}
|
||||
// is_first_digit = byte(lit_sans_sign[0]).is_digit()
|
||||
if lit.len > 1 && lit_sans_sign.starts_with('0') {
|
||||
if lit.len > 1 && lit_sans_sign.starts_with('0') && !lit_sans_sign.starts_with('0.') {
|
||||
ascii = byte(lit_sans_sign[0]).ascii_str()
|
||||
return error(@MOD + '.' + @STRUCT + '.' + @FN +
|
||||
' numbers like "$lit" can not start with `$ascii` in ...${c.excerpt(num.pos)}...')
|
||||
|
@ -15,7 +15,6 @@ const (
|
||||
|
||||
// Kept for easier handling of future updates to the tests
|
||||
valid_exceptions = [
|
||||
'values/spec-float-3.toml',
|
||||
'values/spec-float-10.toml',
|
||||
'values/spec-float-11.toml',
|
||||
'values/spec-float-12.toml',
|
||||
|
Loading…
Reference in New Issue
Block a user