1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 18:13:56 +03:00
juvix/app/Commands/Dev/Scope.hs

16 lines
533 B
Haskell
Raw Normal View History

module Commands.Dev.Scope where
2022-09-14 17:16:15 +03:00
import Commands.Base
import Commands.Dev.Scope.Options
import Juvix.Compiler.Concrete.Pretty qualified as Scoper
2022-09-14 17:16:15 +03:00
import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping qualified as Scoper
runCommand :: (Members '[Embed IO, App] r) => ScopeOptions -> Sem r ()
2022-09-14 17:16:15 +03:00
runCommand opts = do
globalOpts <- askGlobalOptions
l <-
(^. Scoper.resultModules)
<$> runPipeline (opts ^. scopeInputFile) upToScoping
forM_ l $ \s -> do
renderStdOut (Scoper.ppOut (globalOpts, opts) s)