Currently, the built-in parser only supports f64 numbers.
We can easily separate numbers into f64 and i64s by if they have decimals or not.
But what about other sizes? This is where it gets a tad complicated because we want type inference. Technically we don't need type inference but needing to specify the type of a number every time gets annoying pretty quickly.
Solutions
Rust uses whats known as a Hindley–Milner type system, but the Wikipedia article about it seems quite complicated. So I think that's a no-go (unless someone else decides to contribute it in, help would be appreciated)
An easier approach would be to look at what the function/variable assignment is expecting and use that, if that doesn't help then default to i32 / f32.
Currently, the built-in parser only supports
f64
numbers.We can easily separate numbers into
f64
andi64
s by if they have decimals or not.But what about other sizes? This is where it gets a tad complicated because we want type inference. Technically we don't need type inference but needing to specify the type of a number every time gets annoying pretty quickly.
Solutions
Rust uses whats known as a Hindley–Milner type system, but the Wikipedia article about it seems quite complicated. So I think that's a no-go (unless someone else decides to contribute it in, help would be appreciated)
An easier approach would be to look at what the function/variable assignment is expecting and use that, if that doesn't help then default to
i32
/f32
.