aboutsummaryrefslogtreecommitdiff
path: root/pseudocode-lib/_exp_string.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-20 11:03:17 +0000
committer_ov4 <ov4@ov4.org>2026-10-20 11:03:17 +0000
commit079764b8f04f4ae69a3a014224a45a04a157edad (patch)
treeb09334ed42ba61b2d053d77fc1d00a085f497b2e /pseudocode-lib/_exp_string.cc
parent496c020541d4d35e5800b813b3f8d113a8f2b90b (diff)
feat(library): add experimental string ASC overloads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'pseudocode-lib/_exp_string.cc')
-rw-r--r--pseudocode-lib/_exp_string.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/pseudocode-lib/_exp_string.cc b/pseudocode-lib/_exp_string.cc
index bd476b8..6a17f74 100644
--- a/pseudocode-lib/_exp_string.cc
+++ b/pseudocode-lib/_exp_string.cc
@@ -113,6 +113,15 @@ char _exp_string_impl_ucase_char(char Ch) {
return static_cast<char>(std::toupper(static_cast<unsigned char>(Ch)));
});
}
+long long _exp_string_impl_asc(void *Handle) {
+ return checked([&]() -> long long {
+ const auto &Source = text(Handle);
+ return Source.empty() ? 0 : static_cast<unsigned char>(Source.front());
+ });
+}
+long long _exp_string_impl_asc_char(char Ch) {
+ return checked([&]() -> long long { return static_cast<unsigned char>(Ch); });
+}
void _exp_string_impl_output(void *Handle) {
checked([&] {
const auto &Text = text(Handle);