lua-fmt icon indicating copy to clipboard operation
lua-fmt copied to clipboard

Formatting changed the code

Open nico-abram opened this issue 7 years ago • 2 comments

image

Running the formatter here changed the code's meaning/purpose. It's a bit of an edge case. Changing it to have an if instead of "or function() end" made the formatter work properly

nico-abram avatar Sep 20 '18 02:09 nico-abram

This definitely isn't an edge case! Using semicolons to end statements in Lua is commonplace in many projects. The most common case is when you must begin a statement with a parenthesis, in which you need a semicolon to terminate the previous statement otherwise Lua won't parse it as it's ambiguous syntax.

evaera avatar Oct 08 '18 21:10 evaera

This should be marked as bug

nico-abram avatar Nov 05 '18 01:11 nico-abram