From 67cd90de6e019e431265ec13ff4d805b07d5eb8a Mon Sep 17 00:00:00 2001 From: yuyi Date: Sat, 18 Apr 2020 02:31:32 +0800 Subject: [PATCH] parser: fix number parse error --- vlib/v/parser/parser.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index bc76a035b9..50a4c2fdb5 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -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 }