mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
toml: fix float checker bug for -0.01
(#12590)
This commit is contained in:
parent
d52b62a4f4
commit
22043f2df1
2 changed files with 1 additions and 3 deletions
|
@ -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)}...')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue