aboutsummaryrefslogtreecommitdiff
path: root/include/cps/AST.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 09:09:54 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 09:09:54 +0000
commit59a2bb6acb975d820ab29be63a6f909d6e6ef40f (patch)
treeac87916075e9e5a9f166b14fea0b39864d801166 /include/cps/AST.h
parentdc645a36aaade7087ade574cefe69ce7bb29753e (diff)
feat(parser): parse INCLUDE and GLOBAL blocks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/AST.h')
-rw-r--r--include/cps/AST.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/cps/AST.h b/include/cps/AST.h
index f20b106..8c8c3be 100644
--- a/include/cps/AST.h
+++ b/include/cps/AST.h
@@ -100,6 +100,21 @@ public:
virtual ~StmtAST() = default;
};
+class IncludeStmtAST : public StmtAST {
+ std::string Path;
+public:
+ explicit IncludeStmtAST(std::string Path) : Path(std::move(Path)) {}
+ const std::string &getPath() const { return Path; }
+};
+
+class GlobalBlockAST : public StmtAST {
+ std::vector<std::unique_ptr<StmtAST>> Body;
+public:
+ explicit GlobalBlockAST(std::vector<std::unique_ptr<StmtAST>> Body)
+ : Body(std::move(Body)) {}
+ const auto &getBody() const { return Body; }
+};
+
class TryStmtAST : public StmtAST {
std::vector<std::unique_ptr<StmtAST>> Body, CatchBody;
public: