diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 10:09:47 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 10:09:47 +0000 |
| commit | e2c65706e61be09ddb7eeb28cd1957acd4317bcf (patch) | |
| tree | 15447a03d67d395a722c5be3f0b05bc9f197197a /include/cps/AST.h | |
| parent | 45c9d37eb27d204a6202b33cb37e890af0171357 (diff) | |
feat(constants): implement literal constants with lexical scope
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/AST.h')
| -rw-r--r-- | include/cps/AST.h | 10 |
1 files changed, 10 insertions, 0 deletions
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<ExprAST> Value; +public: + ConstantStmtAST(std::string Name, std::unique_ptr<ExprAST> 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; |
