diff --git a/examples/reid/easiest.reid b/examples/reid/easiest.reid index 0d57517..2033023 100644 --- a/examples/reid/easiest.reid +++ b/examples/reid/easiest.reid @@ -6,7 +6,7 @@ fn main() { let hello = 32 + { 2 + 3 }; - let beep = hello + fibonacci(15); + let beep = hello + fibonacci(); return beep; } @@ -17,4 +17,4 @@ fn fibonacci(value: i32) -> i32 { return 1; } return fibonacci(value - 1) + fibonacci(value - 2); -} \ No newline at end of file +} diff --git a/src/ast.rs b/src/ast.rs index 4b56eb4..6d240ae 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -305,8 +305,13 @@ impl Parse for Block { while !matches!(stream.peek(), Some(Token::BraceClose)) { if let Some((r_type, e)) = return_stmt.take() { - println!("Oh no, does this statement lack ;"); - dbg!(r_type, &e); + // Special list of expressions that are simply not warned about, + // if semicolon is missing. + if !matches!(&e, &Expression::IfExpr(_)) { + dbg!(r_type, &e); + println!("Oh no, does this statement lack ;"); + } + statements.push(BlockLevelStatement::Expression(e)); } let statement = stream.parse()?; diff --git a/src/lexer.rs b/src/lexer.rs index 15bd28e..20e128e 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -137,7 +137,7 @@ pub fn tokenize>(to_tokenize: T) -> Result, Error w if w.is_whitespace() => continue, // Comments '/' if cursor.first() == Some('/') => { - while !matches!(cursor.first(), Some('\n')) { + while !matches!(cursor.first(), Some('\n') | None) { cursor.next(); } continue;