From a6b8afcfb61e1d321405fe8713beaec2aa6320a2 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 05:08:42 +0000 Subject: feat(input): support array elements and member targets Co-Authored-By: Claude Fable 5.1 --- include/cps/AST.h | 6 +++--- include/cps/CodeGen.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/cps/AST.h b/include/cps/AST.h index 5aadc21..c7764c6 100644 --- a/include/cps/AST.h +++ b/include/cps/AST.h @@ -170,10 +170,10 @@ public: }; class InputStmtAST : public StmtAST { - std::string Name; + std::unique_ptr Target; public: - InputStmtAST(const std::string &Name) : Name(Name) {} - const std::string &getName() const { return Name; } + InputStmtAST(std::unique_ptr Target) : Target(std::move(Target)) {} + ExprAST *getTarget() const { return Target.get(); } }; class OutputStmtAST : public StmtAST { diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 3c80eb8..883cf71 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -89,7 +89,7 @@ class CodeGen { 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); + void emitCInput(llvm::Value *Addr, const TypeInfo *Info); // TYPE-system registration (Designator.cc) and operators (TypeCheckGen.cc). void runTypePrePass(const std::vector> &Statements); -- cgit v1.3.1-4-g156e