Closed glguy closed 8 years ago
It occurs to me that we should simply always emit the ; for empty statements. It improves the round trip story and resolves a portion of this issue. (Manually generated syntax trees could still produce incorrect concrete syntax)
Lua's grammar is ambiguous when it comes to parsing
f()(f)()
. Just following the grammar this could be either one statement or two. It'll probably be messy, but the pretty printer needs to know when the previous statement was a function call or if the previous statement ended in an expression that could be a prefix expression for a function call.