From 4d5ab959463d87aea4c85c2b457d0a44b11d2d4c Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 11 May 2018 01:39:31 -0700 Subject: [PATCH] Fix bug with / parsing --- schala-lang/src/parsing.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schala-lang/src/parsing.rs b/schala-lang/src/parsing.rs index ef50460..e807d72 100644 --- a/schala-lang/src/parsing.rs +++ b/schala-lang/src/parsing.rs @@ -563,6 +563,7 @@ impl Parser { Operator(op) => op, Period => Rc::new(".".to_string()), Pipe => Rc::new("|".to_string()), + Slash => Rc::new("/".to_string()), _ => unreachable!(), }; let rhs = self.precedence_expr(new_precedence)?; @@ -975,6 +976,7 @@ mod parse_tests { [exprstatement!(binexp!("*", binexp!("+", IntLiteral(1), IntLiteral(2)), IntLiteral(3)))])); parse_test!(".1 + .2", AST(vec![exprstatement!(binexp!("+", FloatLiteral(0.1), FloatLiteral(0.2)))])); + parse_test!("1 / 2", AST(vec![exprstatement!(binexp!("/", IntLiteral(1), IntLiteral(2)))])); } #[test]