Crafting Interpreters in Rust: Adding strings to the grammar

We’re implementing Lox’s primary rule. So far, we’ve done booleans, nil and numbers. Let’s move on to strings. In the book, Lox’s primary rule looks like this: primary → NUMBER | STRING | "true" | "false" | "nil" | "(" expression ")" ; We start with a test: #[test] fn strings () { let parser = lox :: PrimaryParser :: new (); assert_eq! (parser . parse ( " \"\" " ) . unwrap (), Primary :: String (…