diff options
| author | Carson Fleming <cflems@cflems.net> | 2026-07-29 23:58:55 -0400 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2026-07-29 23:58:55 -0400 |
| commit | 3445947c072a4cd533f5f3a53178f77361859123 (patch) | |
| tree | 9ba7d330b1091fdad76bbb190579491e022dc3d3 /type.c | |
| parent | 29510d33cab6e86b28b12c6246bca58acdab26e2 (diff) | |
| download | ccc-3445947c072a4cd533f5f3a53178f77361859123.tar.gz | |
improve type system
Diffstat (limited to 'type.c')
| -rw-r--r-- | type.c | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -42,11 +42,29 @@ const struct data_type double_type = { .is_floating = true, }; -const struct data_type* integral_type = &long_type; -const struct data_type* floating_type = &double_type; -const struct data_type* character_type = &char_type; const struct data_type* primitive_types[] = { &void_type, &char_type, &short_type, &int_type, &long_type, &long_long_type, &float_type, &double_type, NULL }; + +const struct type integral_type = { + .type = TP_DATA, + .data.data_type = &long_type, + .data.is_signed = true, +}; +const struct type floating_type = { + .type = TP_DATA, + .data.data_type = &double_type, + .data.is_signed = true, +}; +const struct type character_type = { + .type = TP_DATA, + .data.data_type = &char_type, + .data.is_signed = true, /* impl defined */ +}; +const struct type string_type = { + .type = TP_PTR, + .pointer.data_type = &char_type, + .pointer.ptr_level = 1, +}; |
