aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ast/CC/Context.hs5
-rw-r--r--compcomp.cabal4
-rw-r--r--main/Main.hs2
-rw-r--r--parser/CC/Parser.hs1
-rw-r--r--typecheck/CC/Typecheck.hs1
-rw-r--r--utils/CC/Types.hs3
6 files changed, 10 insertions, 6 deletions
diff --git a/ast/CC/Context.hs b/ast/CC/Context.hs
new file mode 100644
index 0000000..1f8c673
--- /dev/null
+++ b/ast/CC/Context.hs
@@ -0,0 +1,5 @@
+module CC.Context where
+
+
+-- | Source metadata for compilation
+data Context = Context FilePath
diff --git a/compcomp.cabal b/compcomp.cabal
index c7fec4e..6635172 100644
--- a/compcomp.cabal
+++ b/compcomp.cabal
@@ -15,7 +15,7 @@ executable compcomp
import: deps
hs-source-dirs: main
main-is: Main.hs
- build-depends: cc-parser, cc-typecheck, cc-utils
+ build-depends: cc-parser, cc-typecheck, cc-ast, cc-utils
library cc-parser
import: deps
@@ -33,7 +33,7 @@ library cc-ast
import: deps
hs-source-dirs: ast
build-depends: cc-utils
- exposed-modules: CC.AST.Source, CC.AST.Typed
+ exposed-modules: CC.AST.Source, CC.AST.Typed, CC.Context
library cc-utils
import: deps
diff --git a/main/Main.hs b/main/Main.hs
index dbac4c4..f5a3d5a 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -5,8 +5,8 @@ import System.Exit
import qualified CC.Parser as Parser
import qualified CC.Typecheck as Typecheck
+import CC.Context
import CC.Pretty
-import CC.Types
-- Put the passes in a type-level list to be able to run subsequences of
diff --git a/parser/CC/Parser.hs b/parser/CC/Parser.hs
index f8e482e..76f0b68 100644
--- a/parser/CC/Parser.hs
+++ b/parser/CC/Parser.hs
@@ -5,6 +5,7 @@ import Text.Parsec hiding (SourcePos, getPosition, token)
import qualified Text.Parsec
import CC.AST.Source
+import CC.Context
import CC.Pretty
diff --git a/typecheck/CC/Typecheck.hs b/typecheck/CC/Typecheck.hs
index 0c926f3..aac7923 100644
--- a/typecheck/CC/Typecheck.hs
+++ b/typecheck/CC/Typecheck.hs
@@ -12,6 +12,7 @@ import Data.Set (Set)
import CC.AST.Source
import CC.AST.Typed
+import CC.Context
import CC.Pretty
diff --git a/utils/CC/Types.hs b/utils/CC/Types.hs
index b377045..84c62b2 100644
--- a/utils/CC/Types.hs
+++ b/utils/CC/Types.hs
@@ -6,9 +6,6 @@ import CC.Pretty
-- | Names of variables in the program
type Name = String
--- | Source metadata for compilation
-data Context = Context FilePath
-
-- | Position in a source file; `SourcePos line column`, both zero-based
data SourcePos = SourcePos Int Int
deriving (Show, Read, Eq, Ord)