diff options
| author | nic-gaffney <gaffney_nic@protonmail.com> | 2023-04-27 17:18:11 -0500 |
|---|---|---|
| committer | nic-gaffney <gaffney_nic@protonmail.com> | 2023-04-27 17:18:11 -0500 |
| commit | 757e804671ef3dcb2e0f1295e385780b5feae2ca (patch) | |
| tree | 94d1c0e68bff9aaddcfee8c07bbc1634b1e20195 | |
| parent | 19fefeb732d559195edb01ebc36170c0cf9a0308 (diff) | |
| download | sloth-757e804671ef3dcb2e0f1295e385780b5feae2ca.tar.gz | |
Standard library finished for now
| -rw-r--r-- | crates/sloth/src/parser/stmt.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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); |
