From 45c9d37eb27d204a6202b33cb37e890af0171357 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 10:04:27 +0000 Subject: feat(control-flow): implement ordered CASE OF matching Co-Authored-By: Claude Fable 5.1 --- include/cps/CodeGen.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 72b96c6..4259d63 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -70,13 +70,17 @@ class CodeGen { llvm::Value *convertNumericValue(llvm::Value *Val, const TypeInfo *Source, const TypeInfo *Target); llvm::Value *emitCast(CastExprAST *Cast); - llvm::Value *emitCBinaryOp(BinaryExprAST *Bin, const TypeInfo *Left, const TypeInfo *Right); + llvm::Value *emitBinaryOp(int Op, llvm::Value *L, const TypeInfo *LT, + llvm::Value *R, const TypeInfo *RT, int Line); + llvm::Value *emitCBinaryOp(int Op, llvm::Value *L, const TypeInfo *Left, + llvm::Value *R, const TypeInfo *Right, int Line); void emitCOutput(llvm::Value *Val, const TypeInfo *Info, bool AppendNewline); void emitCInput(const SymbolInfo *Symbol, const TypeInfo *Info); // TYPE-system registration (Designator.cc) and operators (TypeCheckGen.cc). void runTypePrePass(const std::vector> &Statements); - llvm::Value *emitUserKindBinaryOp(BinaryExprAST *Bin, const TypeInfo *LT, const TypeInfo *RT); + llvm::Value *emitUserKindBinaryOp(int Op, llvm::Value *L, const TypeInfo *LT, + llvm::Value *R, const TypeInfo *RT, int Line); // An addressable location and the pseudocode type stored there. struct LValueInfo { @@ -95,6 +99,7 @@ class CodeGen { void emitDeclareStmt(DeclareStmtAST *Stmt); void emitOutputValue(llvm::Value *Val, const TypeInfo *TypeInfo, bool AppendNewline = true); + void emitCaseStmt(CaseStmtAST *Stmt); void emitIfStmt(IfStmtAST *Stmt); void emitTryStmt(TryStmtAST *Stmt); void emitWhileStmt(WhileStmtAST *Stmt); -- cgit v1.3.1-4-g156e