From 713a313b06256a13ddefa5e257e3b80f8aa808ba Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 15:32:49 +0000 Subject: feat(codegen): convert implicitly between CHAR and STRING A CHAR becomes a one-character STRING in &, comparisons, assignment, parameter passing and RETURN. A STRING becomes a CHAR in assignment, parameter passing and RETURN, with a runtime error when its length is not 1. CHAR with INTEGER or BOOLEAN still does not convert. Co-Authored-By: Claude Sonnet 5.5 --- pseudocode-lib/string.cps | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pseudocode-lib') diff --git a/pseudocode-lib/string.cps b/pseudocode-lib/string.cps index 41181c4..a118326 100644 --- a/pseudocode-lib/string.cps +++ b/pseudocode-lib/string.cps @@ -52,6 +52,9 @@ CLASS STRING OVERLOAD PROCEDURE OPERATOR<-(Text : C_STRING) CALL _string_impl_assign_cstr(_HANDLE, Text) ENDPROCEDURE + FUNCTION _LENGTH() RETURNS INTEGER + RETURN (INTEGER)_string_impl_length(_HANDLE) + ENDFUNCTION FUNCTION C_STR() RETURNS C_STRING RETURN _string_impl_c_str(_HANDLE) ENDFUNCTION -- cgit v1.3.1-4-g156e