nlsandler / write_a_c_compiler

Test suite to help you write your own C compiler
https://norasandler.com/2017/11/29/Write-a-Compiler.html
MIT License
855 stars 97 forks source link

"-" operator changes names between Week 2 and Week 3 #26

Closed retop56 closed 10 months ago

retop56 commented 10 months ago

Attached screenshots can be found below.

In week 2, the "-" operator is referred to as the "negation" operator, while in week 3 it's referred to as the "minus" operator. Is the difference intentional, and if so, why?

Thank you for creating this series of blogposts and the accompanying test suite. Looking forward to the release of the book!

Screenshot 2023-11-26 121220 Screenshot 2023-11-26 121316

nlsandler commented 10 months ago

The difference isn't intentional. I generally use "minus" when talking about the binary operator and "negation" when talking about the unary operator - but the token is the same in both chapters, so strictly speaking it should have the same name. However, I'm probably not going to fix this since I'm no longer actively working on these blog posts - I'll still fix errors in these posts but generally not wording inconsistencies and the like.

But thanks for reporting this, and for the kind words about the series!