Crafting Interpreters in Rust: Parsing Binary Operators, part 1

In the previous post, we finished implementing parsing of unary operators. In this post, we’ll take a look at the first of the binary operators: division and multiplication. Division As usual, we start with a test: #[test] fn division () { let parser = lox :: ExpressionParser :: new (); let expr = parser . parse ( "12 / 3" ) . unwrap (); assert_eq! ( expr, Expression :: Divide { left : Box :: new…