aboutsummaryrefslogtreecommitdiff
path: root/boot/symbol.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-08-01 20:03:34 +0200
committerEugen Wissner <belka@caraus.de>2026-08-01 20:03:34 +0200
commite9cd3e5d0157f145dc0c3fea59f434fdd5ae55c6 (patch)
tree90ba6af2fe70ab961cdf48b46caa669757cd11b7 /boot/symbol.cc
parent71b3bbb7698b13b42c99a4ca66c27db4a6189ff8 (diff)
downloadelna-e9cd3e5d0157f145dc0c3fea59f434fdd5ae55c6.tar.gz
Evaluate strings at compile time
Diffstat (limited to 'boot/symbol.cc')
-rw-r--r--boot/symbol.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/boot/symbol.cc b/boot/symbol.cc
index a51ee01..6172621 100644
--- a/boot/symbol.cc
+++ b/boot/symbol.cc
@@ -456,6 +456,18 @@ namespace elna::boot
|| checked.get<enumeration_type>() != nullptr;
}
+ bool is_string_type(const type& checked)
+ {
+ if (auto slice = checked.get<slice_type>())
+ {
+ if (auto base = resolve_aliases(slice->base).get<constant_type>())
+ {
+ return is_primitive_type(resolve_aliases(base->unqualified), "Char");
+ }
+ }
+ return false;
+ }
+
type get_range_base_type(const type& range)
{
if (auto array = range.get<array_type>())