diff options
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, +}; |
