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

14 lines
481 B
Haskell
Raw Normal View History

module Commands.Dev.Parse where
2022-09-14 17:16:15 +03:00
import Commands.Base
import Commands.Dev.Parse.Options
import Juvix.Compiler.Concrete.Translation.FromSource qualified as Parser
import Text.Show.Pretty (ppShow)
runCommand :: (Members '[Embed IO, App] r) => ParseOptions -> Sem r ()
2022-09-14 17:16:15 +03:00
runCommand opts = do
m <-
head . (^. Parser.resultModules)
<$> runPipeline (opts ^. parseOptionsInputFile) upToParsing
if opts ^. parseOptionsNoPrettyShow then say (show m) else say (pack (ppShow m))