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

14 lines
493 B
Haskell

module Commands.Dev.Parse where
import Commands.Base
import Commands.Dev.Parse.Options
import Juvix.Compiler.Concrete.Translation.FromSource qualified as Parser
import Text.Show.Pretty (ppShow)
runCommand :: (Members '[EmbedIO, App, TaggedLock] r) => ParseOptions -> Sem r ()
runCommand opts = do
m <-
(^. Parser.resultModule)
<$> runPipelineNoOptions (opts ^. parseOptionsInputFile) upToParsing
if opts ^. parseOptionsNoPrettyShow then say (show m) else say (pack (ppShow m))