toml: fix hex values starting with a, e or E and comments ending with crlf (#12367)

This commit is contained in:
Larpon 2021-11-02 18:07:27 +01:00 committed by GitHub
parent 3fdbfca202
commit 99fd84dfe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 6 deletions

View file

@ -141,12 +141,6 @@ fn (c Checker) check_number(num ast.Number) ? {
is_oct = lit_sans_sign.starts_with('0o')
is_hex = lit_sans_sign.starts_with('0x')
third := lit[2]
if third in scanner.digit_extras {
ascii = byte(third).ascii_str()
return error(@MOD + '.' + @STRUCT + '.' + @FN +
' numbers like "$lit" (hex, octal and binary) can not have `$ascii` in ...${c.excerpt(num.pos)}...')
}
lit_sans_sign_and_type_prefix := lit_sans_sign[2..]
if lit_sans_sign_and_type_prefix.starts_with('_')