diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-08-01 09:30:39 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-08-01 09:34:21 +0200 |
| commit | 8539c10542a4be1e1127daea60bf1b1e4c37e092 (patch) | |
| tree | f04e3b0e97e4d201ee5ebdb0b2bd9079af4b1820 /boot/name_analysis.cc | |
| parent | 661c29a7835cf1755deaf21f91832f00e958a318 (diff) | |
| download | elna-8539c10542a4be1e1127daea60bf1b1e4c37e092.tar.gz | |
Fix compile-time negation and array access
Diffstat (limited to 'boot/name_analysis.cc')
| -rw-r--r-- | boot/name_analysis.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/boot/name_analysis.cc b/boot/name_analysis.cc index b8cd83e..7ced7ea 100644 --- a/boot/name_analysis.cc +++ b/boot/name_analysis.cc @@ -789,15 +789,16 @@ namespace elna::boot } } - void name_analysis_visitor::visit(literal<std::int32_t> *literal) - { - literal->type_decoration = lookup_primitive_type("Int"); - this->current_type = literal->type_decoration; - } - void name_analysis_visitor::visit(literal<integer_literal> *literal) { - literal->type_decoration = lookup_primitive_type("Word"); + if (literal->value.is_signed()) + { + literal->type_decoration = lookup_primitive_type("Int"); + } + else + { + literal->type_decoration = lookup_primitive_type("Word"); + } this->current_type = literal->type_decoration; } |
