aboutsummaryrefslogtreecommitdiff
path: root/pseudocode-lib/string.cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-23 01:21:23 +0000
committer_ov4 <ov4@ov4.org>2026-10-23 01:21:23 +0000
commita0dba2acdeb6e2e9af8e53a4d886fba79c7a3afe (patch)
treedd2ee26ba4fe80999d509daa1b96888b76c90dbb /pseudocode-lib/string.cps
parent90fc80c193453e8d5038530f310fc007f9ff9789 (diff)
feat(stdlib): add a CHAR overload of STR_TO_NUM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'pseudocode-lib/string.cps')
-rw-r--r--pseudocode-lib/string.cps6
1 files changed, 5 insertions, 1 deletions
diff --git a/pseudocode-lib/string.cps b/pseudocode-lib/string.cps
index 1ad63d3..cb06758 100644
--- a/pseudocode-lib/string.cps
+++ b/pseudocode-lib/string.cps
@@ -78,9 +78,13 @@ OVERLOAD FUNCTION NUM_TO_STR(Number : REAL) RETURNS STRING
CALL _string_impl_from_real(Result._HANDLE, (C_DOUBLE)Number)
RETURN Result
ENDFUNCTION
-FUNCTION STR_TO_NUM(S : STRING) RETURNS REAL
+OVERLOAD FUNCTION STR_TO_NUM(S : STRING) RETURNS REAL
RETURN (REAL)_string_impl_to_real(S._HANDLE)
ENDFUNCTION
+OVERLOAD FUNCTION STR_TO_NUM(C : CHAR) RETURNS REAL
+ DECLARE S : STRING(1, (C_CHAR)C)
+ RETURN STR_TO_NUM(S)
+ENDFUNCTION
FUNCTION LENGTH(S : STRING) RETURNS INTEGER
RETURN (INTEGER)_string_impl_length(S._HANDLE)
ENDFUNCTION