Koihik / LuaFormatter

Code formatter for Lua
Apache License 2.0
715 stars 86 forks source link

Add feature to remove unnecessary semicolons #77

Open tammela opened 4 years ago

tammela commented 4 years ago

Semicolons are present in the language because they solve an ambiguity in the grammar.

The reference manual explains this clearly in §3.3.1

honeytbitw commented 4 years ago

I want to work on this issue. Can u guide me how do I do it?

tammela commented 4 years ago

Hello,

This issue states that we desire a feature to remove unnecessary semicolons in the code. Semicolons are in the language to solve an ambiguity in the grammar, as referenced above.

The ideia is to remove every semicolon, but checking if the AST structure would become ambiguous.

An example:

-- before
local a = 10;local b = 11

-- after
local a = 10 local b = 11

Here the grammar is not ambiguous without the semicolons, so it's ok to remove them.

On Tue, 25 Feb 2020, 17:00 honeytbitw, notifications@github.com wrote:

I want to work on this issue. Can u guide me how do I do it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Koihik/LuaFormatter/issues/77?email_source=notifications&email_token=ACECBMZ6Z2FLAVO5HAE26TDREU6CDA5CNFSM4KB3QZTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4QW6A#issuecomment-590941048, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACECBM2EAVAR5WACW7EUDB3REU6CDANCNFSM4KB3QZTA .