]> ocean-lang.org Git - ocean/commit
oceani: handle variable-sized arrays better.
authorNeilBrown <neil@brown.name>
Thu, 14 Oct 2021 02:43:02 +0000 (13:43 +1100)
committerNeilBrown <neil@brown.name>
Sat, 30 Oct 2021 22:18:19 +0000 (09:18 +1100)
commit3c4cea0b5abc137df4b26ef443f24186cf9cb3f5
treee6e3168c46b4d91a4430f9573e9c5324a90a32b1
parentb5a63d46c787e442d44b5fd1d70d007498bd5058
oceani: handle variable-sized arrays better.

An array with size set by a constant variable(!) might have a different
size each time the declaration is encountered.  So we need to
re-evaluate the size each time.
We currently re-evaluate the size only if it is zero.

So for numerical-constant sized arrays, evaluate size during parsing.
For other arrays, re-evaulate each time using a new prepare_type method.

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