toml: fix bin, oct and hex capital identifier check (#12254)
parent
5607224be6
commit
a84b1a53ec
|
@ -101,6 +101,10 @@ fn (c Checker) check_number(num ast.Number) ? {
|
||||||
} else {
|
} else {
|
||||||
if !hex_bin_oct {
|
if !hex_bin_oct {
|
||||||
if !is_float && lit[0] == `0` {
|
if !is_float && lit[0] == `0` {
|
||||||
|
if lit[1] in [`B`, `O`, `X`] {
|
||||||
|
return error(@MOD + '.' + @STRUCT + '.' + @FN +
|
||||||
|
' numbers like "$lit" only lowercase notation in ...${c.excerpt(num.pos)}...')
|
||||||
|
}
|
||||||
return error(@MOD + '.' + @STRUCT + '.' + @FN +
|
return error(@MOD + '.' + @STRUCT + '.' + @FN +
|
||||||
' numbers like "$lit" can not start with a zero in ...${c.excerpt(num.pos)}...')
|
' numbers like "$lit" can not start with a zero in ...${c.excerpt(num.pos)}...')
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ const (
|
||||||
'string/basic-out-of-range-unicode-escape-2.toml',
|
'string/basic-out-of-range-unicode-escape-2.toml',
|
||||||
'string/bad-uni-esc.toml',
|
'string/bad-uni-esc.toml',
|
||||||
// Integer
|
// Integer
|
||||||
'integer/capital-bin.toml',
|
|
||||||
'integer/invalid-bin.toml',
|
'integer/invalid-bin.toml',
|
||||||
'integer/invalid-oct.toml',
|
'integer/invalid-oct.toml',
|
||||||
// Encoding
|
// Encoding
|
||||||
|
|
Loading…
Reference in New Issue