From 21e6e5940ecb462436b8dc94428c5cee5cdc9072 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 27 Sep 2024 16:20:32 -0600 Subject: Add import resolution phase and also add a more abstractions around compliation phases. --- src/Language/Fiddle/Internal/UnitInterface.hs | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Language/Fiddle/Internal/UnitInterface.hs (limited to 'src/Language/Fiddle/Internal/UnitInterface.hs') diff --git a/src/Language/Fiddle/Internal/UnitInterface.hs b/src/Language/Fiddle/Internal/UnitInterface.hs new file mode 100644 index 0000000..1f12c4c --- /dev/null +++ b/src/Language/Fiddle/Internal/UnitInterface.hs @@ -0,0 +1,34 @@ +module Language.Fiddle.Internal.UnitInterface where + +import Data.Text +import Data.Word +import Language.Fiddle.Internal.Scopes (Scope) +import Language.Fiddle.Types (SourceSpan) + +data Annotated a = Annotated + { sourceSpan :: SourceSpan, + docComment :: Text, + internal :: a + } + deriving (Eq, Ord, Show) + +-- | Contains a datastructure which represents a FiddleUnit. +-- +-- These datastructures contain the exported symobls of a fiddle unit and it's +-- direct dependencies. +data UnitInterface where + UnitInterface :: + { rootScope :: Scope String (Annotated ExportedValue), + dependencies :: [FilePath] + } -> + UnitInterface + deriving (Eq, Ord, Show) + +data ExportedValue where + ExportedBitsType :: + {exportBitsTypeSize :: Word32} -> + ExportedValue + ExportedObjType :: + {exportObjTypeSize :: Word32} -> + ExportedValue + deriving (Show, Eq, Ord) -- cgit