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 --- include/cps/CodeGen.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 539a6e6..9985f9b 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -133,6 +133,8 @@ class CodeGen { std::map StringConstants; const TypeInfo *requireStringType(); llvm::Value *emitStringFromCString(llvm::Value *Text); + llvm::Value *emitStringFromChar(llvm::Value *Ch); + llvm::Value *emitCharFromString(ExprAST *Expr, int Line); llvm::Value *emitStringCString(llvm::Value *Value); llvm::Value *emitCStringExpr(ExprAST *Expr); llvm::Value *emitFileNameOperand(ExprAST *E, const char *Keyword); -- cgit v1.3.1-4-g156e