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

17 lines
584 B
Haskell
Raw Normal View History

2022-09-14 17:16:15 +03:00
module Commands.Dev.Highlight where
import Commands.Base
import Commands.Dev.Highlight.Options
import Juvix.Compiler.Concrete.Data.Highlight qualified as Highlight
import Juvix.Compiler.Pipeline.Run
2022-09-14 17:16:15 +03:00
runCommand :: (Members '[Embed IO, App] r) => HighlightOptions -> Sem r ()
2022-09-14 17:16:15 +03:00
runCommand HighlightOptions {..} = do
entry <- getEntryPoint _highlightInputFile
inputFile <- fromAppPathFile _highlightInputFile
hinput <-
Highlight.filterInput
inputFile
<$> liftIO (runPipelineHighlight entry upToInternalTyped)
sayRaw (Highlight.highlight _highlightBackend hinput)