diff --git a/TODO b/TODO index 9b510e2..1c468c0 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ # Bugs -- Fix `parser::tests::test_parse_compound_ops_with_identifier_first` test # Features diff --git a/examples/playground.sb b/examples/playground.sb index dc24494..e51fc19 100644 --- a/examples/playground.sb +++ b/examples/playground.sb @@ -1,12 +1,11 @@ -main :: () { +fn main() { let num = 10 return fib(num) } -fib :: (n) { +fn fib(n) { if 1 >= n { return n } - return fib(n-1) + fib(n-2) } \ No newline at end of file diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 5c0a910..9bbc6bc 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -292,7 +292,7 @@ impl Parser { } } _ => match BinOp::try_from(self.peek().ok_or("Could not peek token")?.kind) { - Ok(_) => self.parse_bin_op(None)?, + Ok(_) => self.parse_bin_op(Some(Expression::Variable(token.raw)))?, Err(_) => Expression::Variable(val), }, }; diff --git a/src/parser/tests.rs b/src/parser/tests.rs index fd1ffcc..c1b89b6 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -211,7 +211,6 @@ fn test_parse_compound_ops_with_identifier() { } #[test] -#[ignore] fn test_parse_compound_ops_with_identifier_first() { let raw = " fn main(n) {