Closed stevejb71 closed 5 years ago
Thanks for opening this issue! You're correct - this grammar rule would force every expression to be a conditional.
I updated the grammar rule in the blog post to fix this issue:
<conditional-exp> ::= <logical-or-exp> [ "?" <exp> ":" <conditional-exp> ]
Let me know if you'd like me to credit you in the post for catching that mistake!
Yes, a small credit would be very nice. Thank you for offering and also for the great blog series.
Credit: https://norasandler.com/2018/02/25/Write-a-Compiler-6.html#fn5 Thanks again for catching that!
This looks wrong - it forces every expression to be a conditional. Something like the below would be better I think: