From eb99a4c74eeaa2d9e6eb0b6f39d6e0b2c57c0c81 Mon Sep 17 00:00:00 2001 From: sofia Date: Mon, 21 Jul 2025 19:18:39 +0300 Subject: [PATCH] Fix range in literals --- reid/src/ast/parse.rs | 4 ++-- reid_src/hello_world.reid | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/reid/src/ast/parse.rs b/reid/src/ast/parse.rs index 3765d68..ba8b908 100644 --- a/reid/src/ast/parse.rs +++ b/reid/src/ast/parse.rs @@ -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(), ) } } diff --git a/reid_src/hello_world.reid b/reid_src/hello_world.reid index ce7bb35..af7b28b 100644 --- a/reid_src/hello_world.reid +++ b/reid_src/hello_world.reid @@ -1,9 +1,10 @@ import std::print; -fn main() { +fn main() -> i32 { let hello = "hello world"; print(hello); + return 0; }