harec

[hare] Hare compiler, written in C11 for POSIX OSs
Log | Files | Refs | README | LICENSE

commit ddc981b7dcceb86ff6084366ed32e241683a7370
parent 455c64977a07527408376539be13fc0360ee593d
Author: Bor Grošelj Simić <bgs@turminal.net>
Date:   Sat, 18 Feb 2023 02:22:58 +0100

gen: add support for rune enum values in globals

Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>

Diffstat:
Msrc/gen.c | 1+
Mtests/11-globals.ha | 6++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -3668,6 +3668,7 @@ gen_data_item(struct gen_context *ctx, struct expression *expr, break; case STORAGE_I32: case STORAGE_U32: + case STORAGE_RUNE: case STORAGE_INT: // XXX: arch case STORAGE_UINT: item->type = QD_VALUE; diff --git a/tests/11-globals.ha b/tests/11-globals.ha @@ -52,6 +52,12 @@ type aenum = enum u64 { }; const big_value: aenum = aenum::BIG_VALUE; +type renum = enum rune { + R1 = 'a', + R2 = 'g', +}; +let renum_val = renum::R1; + const float: f32 = 1234.5678; const double: f64 = 1234.5678;