Civet
Civet copied to clipboard
Indented declarations
I propose to allow Nested forms of declarations var/let/const/import/export/using. This makes it feel more consistent with other Nested support (e.g. class/interface).
var
one = 1
two = one + 1
let
three = two + 1
four = three + 1
const
five = four + 1
six = five + 1
import
* as foo from 'foo'
{bar} from 'bar'
export
a = 5
{b, c}
using
a = foo()
b = bar()
Basically the proposal is to make the commas between declarations automatic in the nested case. Of course, for import the heading is optional, but it might be nice organizationally to have an explicit import block. For let and const this is an alternative to our existing shorthand .= and :=.
Based on similar features in Nim
This is probably even simpler than https://github.com/DanielXMoore/Civet/pull/677/files