From 39269cc68a32f6e1a7524b00da36a1fe4cc7fb8b Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 21 Aug 2026 00:05:03 +0200 Subject: Implement Single and Double floats --- boot/symbol.cc | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'boot/symbol.cc') diff --git a/boot/symbol.cc b/boot/symbol.cc index 05eea31..fdf6a65 100644 --- a/boot/symbol.cc +++ b/boot/symbol.cc @@ -326,8 +326,10 @@ namespace elna::boot const type pointer = type(std::make_shared("Pointer", target.pointer_properties)); result->enter("Pointer", std::make_shared(pointer)); - result->enter("Float", - std::make_shared(type(std::make_shared("Float", target.float_properties)))); + result->enter("Single", + std::make_shared(type(std::make_shared("Single", target.single_properties)))); + result->enter("Double", + std::make_shared(type(std::make_shared("Double", target.double_properties)))); const type boolean = type(std::make_shared("Bool", target.bool_properties)); result->enter("Bool", std::make_shared(boolean)); @@ -462,22 +464,41 @@ namespace elna::boot return false; } - bool is_numeric_type(const type& checked) + bool is_integer_type(const type& checked) { - return is_integral_type(checked) - || is_primitive_type(checked, "Float"); + if (auto primitive_checked = checked.get()) + { + return primitive_checked->identifier.starts_with("Int"); + } + return false; } - bool is_integral_type(const type& checked) + bool is_word_type(const type& checked) { if (auto primitive_checked = checked.get()) { - return primitive_checked->identifier.starts_with("Int") - || primitive_checked->identifier.starts_with("Word"); + return primitive_checked->identifier.starts_with("Word"); } return false; } + bool is_float_type(const type& checked) + { + return is_primitive_type(checked, "Single") + || is_primitive_type(checked, "Double"); + } + + bool is_numeric_type(const type& checked) + { + return is_integral_type(checked) + || is_float_type(checked); + } + + bool is_integral_type(const type& checked) + { + return is_integer_type(checked) || is_word_type(checked); + } + bool is_discrete_type(const type& checked) { return is_integral_type(checked) @@ -495,7 +516,7 @@ namespace elna::boot bool is_scalar_type(const type& checked) { return is_discrete_type(checked) - || is_primitive_type(checked, "Float") + || is_float_type(checked) || is_any_pointer_type(checked) || checked.get() != nullptr; } -- cgit v1.2.3