parser: fixed problem hexa being casted into float
parent
ee09cde583
commit
6c7eaa7fd3
|
@ -1933,7 +1933,8 @@ fn (p mut Parser) factor() string {
|
||||||
switch tok {
|
switch tok {
|
||||||
case INT:
|
case INT:
|
||||||
typ = '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 = 'f32'
|
||||||
// typ = 'f64' // TODO
|
// typ = 'f64' // TODO
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue