parser.v: document "e" check

pull/689/head
Alexander Medvednikov 2019-06-26 21:44:08 +02:00
parent 6c7eaa7fd3
commit ef737c5e61
1 changed files with 3 additions and 2 deletions

View File

@ -1933,8 +1933,9 @@ fn (p mut Parser) factor() string {
switch tok { switch tok {
case INT: case INT:
typ = 'int' typ = 'int'
//Check if float but not if is hexa // 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`) { if (p.lit.contains('.') || p.lit.contains('e')) &&
!(p.lit[0] == `0` && p.lit[1] == `x`) {
typ = 'f32' typ = 'f32'
// typ = 'f64' // TODO // typ = 'f64' // TODO
} }