Crafting Interpreters in Rust: Parsing Unary Negation
In the last post, we implemented unary-not. In this one, we’ll implement the other unary operator: negation.
In the last post, we implemented unary-not. In this one, we’ll implement the other unary operator: negation.
We’re implementing Lox’s primary rule. So far, we’ve done booleans, nil, numbers and strings. Let’s move on to some
basic expressions. In this post, we’ll deal with unary-NOT – !x.
We’re implementing Lox’s primary rule. So far, we’ve done booleans, nil and numbers. Let’s move on to strings.
So far, we’ve got a grammar that can parse true, false and nil literals. In this post, we’ll add the ability to
parse numbers.
In the previous post, we wrote a simple grammar that parses true or false as a boolean:
For the parser, I’m going to use LALRPOP. I used it in my previous attempt at this, and I liked it.
For my #DecemberAdventure, I’m going to have another go at working through “Crafting
Interpreters” in Rust. The last time I tried this, I got to the end of Chapter 10.