Fix range in literals

This commit is contained in:
Sofia 2025-07-21 19:18:39 +03:00
parent 6d879e5a30
commit eb99a4c74e
2 changed files with 4 additions and 3 deletions

View File

@ -165,12 +165,12 @@ impl Parse for PrimaryExpression {
let value = (*v as f64) + (fractional as f64) / (10u64.pow(log) as f64);
Expression(
Kind::Literal(Literal::Decimal(value)),
stream.get_range_prev().unwrap(),
stream.get_range().unwrap(),
)
} else {
Expression(
Kind::Literal(Literal::Integer(*v)),
stream.get_range_prev().unwrap(),
stream.get_range().unwrap(),
)
}
}

View File

@ -1,9 +1,10 @@
import std::print;
fn main() {
fn main() -> i32 {
let hello = "hello world";
print(hello);
return 0;
}