aboutsummaryrefslogtreecommitdiff
path: root/include/cps/SourceUnit.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 09:13:32 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 09:13:32 +0000
commite1f41ed9fafaf7eb4f2da6878a3fabcf2f7c021e (patch)
treec4cd67b10e8513bb6dfad58e3c3b55033745ed12 /include/cps/SourceUnit.h
parent59a2bb6acb975d820ab29be63a6f909d6e6ef40f (diff)
feat(driver): compile multiple source files with INCLUDE visibility
Reject builds without an entry program and duplicate cross-file definitions. Preserve source order for each unit's own constants and import visible exports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/SourceUnit.h')
-rw-r--r--include/cps/SourceUnit.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/cps/SourceUnit.h b/include/cps/SourceUnit.h
new file mode 100644
index 0000000..db9ad30
--- /dev/null
+++ b/include/cps/SourceUnit.h
@@ -0,0 +1,13 @@
+#pragma once
+#include "cps/AST.h"
+#include <string>
+#include <vector>
+
+namespace cps {
+// The caller owns the parsed statements for the duration of compilation.
+struct SourceUnit {
+ std::string Path;
+ const std::vector<std::unique_ptr<StmtAST>> &Statements;
+ std::vector<bool> Visible;
+};
+}