diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-10-10 16:38:51 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-10-10 16:38:51 -0600 |
commit | c2f195a23bdb0d0dc876cc548d4c3157534082c6 (patch) | |
tree | 658954b31fd7ae55ec87b4304adf024a89c3949d /src/Language/Fiddle/Compiler/ImportResolution.hs | |
parent | 069268394681c95e05cd74ab8bc0dd2ea6c43353 (diff) | |
download | fiddle-c2f195a23bdb0d0dc876cc548d4c3157534082c6.tar.gz fiddle-c2f195a23bdb0d0dc876cc548d4c3157534082c6.tar.bz2 fiddle-c2f195a23bdb0d0dc876cc548d4c3157534082c6.zip |
Add backend support and start implementing a C backend.o
Diffstat (limited to 'src/Language/Fiddle/Compiler/ImportResolution.hs')
-rw-r--r-- | src/Language/Fiddle/Compiler/ImportResolution.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Language/Fiddle/Compiler/ImportResolution.hs b/src/Language/Fiddle/Compiler/ImportResolution.hs index f3ddee0..6ecfc86 100644 --- a/src/Language/Fiddle/Compiler/ImportResolution.hs +++ b/src/Language/Fiddle/Compiler/ImportResolution.hs @@ -12,6 +12,7 @@ import qualified Codec.Compression.GZip as GZip import Control.Arrow (Arrow (second)) import Control.Monad (filterM, when) import Control.Monad.Identity (Identity) +import Control.Monad.State (put) import Control.Monad.Trans.Maybe (MaybeT (MaybeT, runMaybeT)) import Control.Monad.Writer.Lazy (MonadTrans (lift), MonadWriter (tell), WriterT (..), execWriterT) import Data.Aeson (eitherDecode, encode) @@ -31,7 +32,6 @@ import Options.Applicative import System.Directory import System.FilePath import Text.Printf (printf) -import Control.Monad.State (put) newtype Flags = Flags { importDirectories :: [FilePath] @@ -168,8 +168,8 @@ getImportResolutionState parseFile compileToChecked flags unit = do $ execWriterT $ walk doWalk unit () where - doWalk :: forall t'. (Walk t', Typeable t') => t' Identity Annot -> () -> WriterT ([Diagnostic], ResolvedImports) IO () - doWalk u () = + doWalk :: forall t'. (Walk t', Typeable t') => t' Identity Annot -> () -> WriterT ([Diagnostic], ResolvedImports) IO (WalkContinuation ()) + doWalk u () = do case () of () | Just @@ -184,6 +184,7 @@ getImportResolutionState parseFile compileToChecked flags unit = do ResolvedImports $ Map.singleton path (diagnostics, unitInterface) ) _ -> return () + return $ Continue () castTS :: ( Typeable t', |