1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix number parse error

This commit is contained in:
yuyi 2020-04-18 02:31:32 +08:00 committed by GitHub
parent 84ac634c31
commit 67cd90de6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -869,7 +869,7 @@ fn (var p Parser) parse_number_literal() ast.Expr {
lit := p.tok.lit
pos := p.tok.position()
var node := ast.Expr{}
if lit.index_any('.eE') >= 0 {
if lit.index_any('.eE') >= 0 && lit[..2] !in ['0x', '0X', '0o', '0O', '0b', '0B'] {
node = ast.FloatLiteral{
val: lit
}