From ef737c5e619dca5100a937c2e3c7758705021b08 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 26 Jun 2019 21:44:08 +0200 Subject: [PATCH] parser.v: document "e" check --- compiler/parser.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/parser.v b/compiler/parser.v index adcc28b4c4..6423ffb950 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -1933,8 +1933,9 @@ fn (p mut Parser) factor() string { switch tok { case INT: typ = 'int' - //Check if float but not if is hexa - if (p.lit.contains('.') || p.lit.contains('e')) && !(p.lit[0] == `0` && p.lit[1] == `x`) { + // Check if float (`1.0`, `1e+3`) but not if is hexa + if (p.lit.contains('.') || p.lit.contains('e')) && + !(p.lit[0] == `0` && p.lit[1] == `x`) { typ = 'f32' // typ = 'f64' // TODO }