Allow trailing semicolon in list initializers #7
Labels
compiler
Related to the Rant compiler
enhancement
New feature or request
language
Related to the Rant language
Projects
List initializers should allow a trailing semicolon at the end of the element list without automatically creating an empty at the end of the list.
Proposal
The following rules should apply when parsing semicolons in a list initializer context:
An empty list initializer with no semicolons produces an empty list
This is the current behavior, but it is worth noting that this should remain the case.
A semicolon only guarantees a value to its left
Even if there is nothing before the semicolon, it should signal to the compiler that there should be an empty element.
A final value with a terminating semicolon acts the same one without it
If a list ends with a value and no trailing semicolon, it should compile to the same list as one with the semicolon.
The text was updated successfully, but these errors were encountered: