From 757e804671ef3dcb2e0f1295e385780b5feae2ca Mon Sep 17 00:00:00 2001 From: nic-gaffney Date: Thu, 27 Apr 2023 17:18:11 -0500 Subject: Standard library finished for now --- crates/sloth/src/parser/stmt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/sloth/src/parser/stmt.rs b/crates/sloth/src/parser/stmt.rs index 2c48da8..7c468ef 100644 --- a/crates/sloth/src/parser/stmt.rs +++ b/crates/sloth/src/parser/stmt.rs @@ -313,7 +313,7 @@ mod tests { #[test] fn basic_statement_a() { - let lexer = Lexer::new("var test_a = 5 + 3;"); + let lexer = Lexer::new("var test_a: int = 5 + 3;"); let tokens = lexer.collect_vec(); let expected_ast = Stmt::DefineVariable { @@ -323,7 +323,7 @@ mod tests { lhs: (Box::new(Expr::Literal(Literal::Integer(5)))), rhs: (Box::new(Expr::Literal(Literal::Integer(3)))), }), - typ: (None), + typ: Some("int".to_string()), }; let mut parser = AstParser::new(tokens); -- cgit v1.2.3