Current Behavior
Currently, ; is only valid as an alternative to , in a few specific contexts (ExpListLow):
- Return statements:
return a; b
- Assignments:
x = a; b
- Exports:
export x = a; b
This was introduced in 2011 as a "value separator" to help disambiguate from function calls, but it's an obscure feature that few users likely know about or use.
Proposal
Remove the current ; behavior and repurpose it as a statement separator, allowing multiple statements on a single line while preserving the current indentation level. This would align with Lua's syntax.
Examples
-- Simple one-liners
x = 1; y = 2
-- Short related statements
i += 1; j += 1
In block contexts
The semicolon would maintain the current indentation:
if condition
setup!; run!; cleanup!
Equivalent to:
if condition
setup!
run!
cleanup!
Breaking Changes
This removes the ability to use ; as a value separator in return/assignment/export. Users would need to switch to ,:
-- No longer valid
return a; b
-- Use instead
return a, b
This usage is likely rare since , works identically and is more conventional.
Current Behavior
Currently,
;is only valid as an alternative to,in a few specific contexts (ExpListLow):return a; bx = a; bexport x = a; bThis was introduced in 2011 as a "value separator" to help disambiguate from function calls, but it's an obscure feature that few users likely know about or use.
Proposal
Remove the current
;behavior and repurpose it as a statement separator, allowing multiple statements on a single line while preserving the current indentation level. This would align with Lua's syntax.Examples
In block contexts
The semicolon would maintain the current indentation:
Equivalent to:
if condition setup! run! cleanup!Breaking Changes
This removes the ability to use
;as a value separator in return/assignment/export. Users would need to switch to,:This usage is likely rare since
,works identically and is more conventional.