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

parser: fix float_test.v

This commit is contained in:
yuyi 2020-04-08 07:00:58 +08:00 committed by GitHub
parent d54150cd22
commit 9984691eaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1343,7 +1343,7 @@ fn (p mut Parser) map_init() ast.MapInit {
fn (p mut Parser) parse_number_literal() ast.Expr {
lit := p.tok.lit
mut node := ast.Expr{}
if lit.contains('.') {
if lit.index_any('.eE') >= 0 {
node = ast.FloatLiteral{
val: lit
}