Open SquidDev opened 4 years ago
Another case where this occurs is the following:
do return(x)end
This will be much harder to fix. It's times like these I wish we had a zipper list of tokens on top of our AST. Maybe I should just give up and force the pretty printer to emit correct code here.
why not replace them with spaces, and then do a pass to see if there are any double-spaces not at the start of a line
/(?:^\s*.*)\s\s+/
replaced with a single space
Consider the following:
While somewhat dubious Lua, it is technically valid. However, when removing the redundant parenthesis, Lua rewrites this as the following, which is clearly not the same!