From 6c7eaa7fd367428e30c26df34230d0a0f7efaac7 Mon Sep 17 00:00:00 2001 From: Henrixounez Date: Wed, 26 Jun 2019 21:23:05 +0200 Subject: [PATCH] parser: fixed problem hexa being casted into float --- compiler/parser.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/parser.v b/compiler/parser.v index 6ffceace75..adcc28b4c4 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -1933,7 +1933,8 @@ fn (p mut Parser) factor() string { switch tok { case INT: typ = 'int' - if p.lit.contains('.') || p.lit.contains('e') { + //Check if float 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 }