aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-09-08 10:46:13 +0200
committerEugen Wissner <belka@caraus.de>2026-09-08 10:46:13 +0200
commit72f0f9b9629013e83fc4346a35113e9eecae45b5 (patch)
tree47779eda823f936e1c8d3e99dfc153901497c34f /include
parent72f5e82196d95008ed12c12de6bdccf24361e106 (diff)
downloadelna-72f0f9b9629013e83fc4346a35113e9eecae45b5.tar.gz
Allow compile-time casts
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/evaluator.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/elna/boot/evaluator.h b/include/elna/boot/evaluator.h
index 35cca1a..dc6fd71 100644
--- a/include/elna/boot/evaluator.h
+++ b/include/elna/boot/evaluator.h
@@ -86,8 +86,15 @@ namespace elna::boot
std::optional<std::size_t> evaluate_traits_size(const type& subject);
std::optional<std::size_t> evaluate_traits_alignment(const type& subject);
- static std::optional<constant_value> cast_to_int(const constant_value& source_expression);
- static std::optional<constant_value> cast_to_word(const constant_value& source_expression);
+ static std::optional<constant_value> cast_to_integer(const constant_value& source_expression,
+ bool target_signed, std::size_t target_size);
+ static std::optional<constant_value> cast_to_float(const constant_value& source_expression,
+ float_literal::format_kind target_format);
+ static std::optional<constant_value> cast_to_bool(const constant_value& source_expression);
+ static std::optional<constant_value> cast_to_char(const constant_value& source_expression);
+ static std::optional<constant_value> cast_to_enumeration(const constant_value& source_expression,
+ std::size_t member_count, std::size_t target_size);
+ static std::optional<constant_value> cast_to_pointer(const constant_value& source_expression);
public:
std::optional<std::size_t> evaluate_index(expression& subject);