eolian: fix the nonsensical semantics for variables
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 19 Oct 2016 13:24:26 +0000 (15:24 +0200)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 19 Oct 2016 13:32:22 +0000 (15:32 +0200)
commit8c9fa54be4074d4d7a0237194ecfe5c343876ade
tree05a000fe68fa194dd2c0a949c393183d3d786617
parent73095ad7ad7cf67c2c9a66787da6395bfbdd3e4a
eolian: fix the nonsensical semantics for variables

Both variables and constants can have extern on them (it means the same thing
as in types, they won't get generated in C). This is different from the previous
semantics which only allowed extern on globals, which makes no sense.

Both globals and constants are allowed to have a value (previously only
constants were); constants are required to have a value. Globals having
a value is just a convenience for initialization during source generation.
This is unlike the previous behavior, where the value was optional for both
globals and constants and only allowed when not marked extern, which makes
no sense either.

Obivously, even when globals have a value, they're not allowed to be used
in expressions, as they cannot be evaluated at compile time (they're mutable).
src/lib/eolian/eo_parser.c