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; }