-
Notifications
You must be signed in to change notification settings - Fork 1
Description
What is the problem?
Under current grammar rules trailing commas (inside parentheses enclosing fun
parameter declarations, %struct
literals and struct
s themselves, etc.) aren't allowed.
Expected behaviour
Neither the current behaviour (disallowing trailing commas) nor allowing them can be considered "correct" per se. However, many new languages (Rust, Go) allow them or even require them (in the case of Go).
Proposed Solution
Allowing them is definitely convinient from the standpoint of writing code, for ex. when adding a new member to an enum
one doesn't have to modify any prior lines when always including a trailing ,
. When it comes to readability one can very easily argue that it makes absolutely no difference.
All that's (probably) required is to modify the parser slightly (making grammar rules simpler in the best case, or close to indistinguishable in the worst).