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
|
|
|
|
|
2023-02-10 15:43:13 +03:00
|
|
|
runCommand :: Members '[Embed IO, App] r => HighlightOptions -> Sem r ()
|
2022-09-14 17:16:15 +03:00
|
|
|
runCommand HighlightOptions {..} = do
|
2023-05-10 14:09:48 +03:00
|
|
|
entry <- getEntryPoint _highlightInputFile
|
2023-04-19 17:56:48 +03:00
|
|
|
inputFile <- fromAppPathFile _highlightInputFile
|
2023-05-10 14:09:48 +03:00
|
|
|
hinput <-
|
|
|
|
Highlight.filterInput
|
|
|
|
inputFile
|
|
|
|
<$> liftIO (runPipelineHighlight entry upToInternalTyped)
|
|
|
|
sayRaw (Highlight.highlight _highlightBackend hinput)
|