]> ocean-lang.org Git - ocean/commit
oceani: introduce type->prepare()
authorNeilBrown <neil@brown.name>
Sun, 28 Apr 2019 03:10:15 +0000 (13:10 +1000)
committerNeilBrown <neil@brown.name>
Wed, 1 May 2019 08:09:53 +0000 (18:09 +1000)
commit7254210307fb5abce5630bfad8606e6ebc102ae9
tree805ef5ce649f7d4f7543a4cc1989e5345f4b00da
parent320478cb5a54b80618b66d3553e8f16504388062
oceani: introduce type->prepare()

During parsing and analysis we don't want to "init" a
variable as that can allocate memory - when we add arrays,
we might not know yet how much memory.

So introduce 'prepare' to prepare a value - such that calling
free on it will work - without allocating.

'init' is then called when a variable is declared - unless something
is assigned to it instead.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani.mdc