From e2c65706e61be09ddb7eeb28cd1957acd4317bcf Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 10:09:47 +0000 Subject: feat(constants): implement literal constants with lexical scope Co-Authored-By: Claude Fable 5.1 --- include/cps/AST.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/cps/AST.h') diff --git a/include/cps/AST.h b/include/cps/AST.h index 87c9341..1afc359 100644 --- a/include/cps/AST.h +++ b/include/cps/AST.h @@ -105,6 +105,16 @@ public: class ThrowStmtAST : public StmtAST {}; +class ConstantStmtAST : public StmtAST { + std::string Name; + std::unique_ptr Value; +public: + ConstantStmtAST(std::string Name, std::unique_ptr Value) + : Name(std::move(Name)), Value(std::move(Value)) {} + const std::string &getName() const { return Name; } + ExprAST *getValue() const { return Value.get(); } +}; + class DeclareStmtAST : public StmtAST { std::string Name; std::string Type; -- cgit v1.3.1-4-g156e