Remix.run Logo
aappleby 2 days ago

Yes, but it doesn't need any funny parsing trick to handle them. Just parse the whole statement as a list of expressions joined by operators, and then you can convert the flat list into a precedence-respecting tree with a few lines of code and an operator-to-precedence table.

childintime 2 days ago | parent [-]

Yes, it's as easy as that. Or check out Jonathan Blow on precedence.

The infamous dragon book convinced people to use the wrong tools and have the wrong mindset. It was a work of incompetence. There were no dragons, but the book itself.