marijnh / Eloquent-JavaScript

The sources for the Eloquent JavaScript book
https://eloquentjavascript.net
3.02k stars 796 forks source link

Found redundant code in Ch12 - Parsing #500

Closed jasontwuk closed 4 years ago

jasontwuk commented 4 years ago

Hi, It seems like the first if statement in parseExpression function is redundant. It didn't do anything. After deleting it, the example's result remains the same.

marijnh commented 4 years ago

That parses string literals. You can no longer run print("hello") if you remove it.