]> ocean-lang.org Git - ocean/commitdiff
oceani: allow global constants to be used before declared.
authorNeilBrown <neil@brown.name>
Sat, 4 Dec 2021 22:37:00 +0000 (09:37 +1100)
committerNeilBrown <neil@brown.name>
Sat, 4 Dec 2021 23:02:32 +0000 (10:02 +1100)
When an undeclared name is used, it gets allocated a Tnone variable.
If one of these is found in a 'use' statement, it is assumed to be
a label (that will change later).
If it gets declared as a constant, its type gets set appropriately.

When evaluating global constants, if a value cannot be determined, we
continue with other constants, then, retry.  If the failure was because
some constant was not yet declared, this will eventually resolved.
If resolution is not possible, an error is produced.

Currently, non-global variables and functions cannot resolve.
This is tracking in the new Enoconst prop_err flag.

Signed-off-by: NeilBrown <neil@brown.name>

No differences found