1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/app/Commands/Dev/Highlight.hs
Paul Cadman 37de293c3d
Refactor EntryPoint, Package, Pipeline, Root packages (#2458)
Depends on:
*  https://github.com/anoma/juvix/pull/2451

This PR is part of a series implementing:
* https://github.com/anoma/juvix/issues/2336

In attempt to make the main PR:
* https://github.com/anoma/juvix/pull/2434
easier to review.

Changes in this PR refactor EntryPoint, Package, Pipeline, Root,
splitting out the types into Base modules so that they can be imported
and used in subsequent PRs with fewer dependencies to avoid package
cycles.
2023-10-23 12:38:52 +01:00

17 lines
584 B
Haskell

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
runCommand :: (Members '[Embed IO, App] r) => HighlightOptions -> Sem r ()
runCommand HighlightOptions {..} = do
entry <- getEntryPoint _highlightInputFile
inputFile <- fromAppPathFile _highlightInputFile
hinput <-
Highlight.filterInput
inputFile
<$> liftIO (runPipelineHighlight entry upToInternalTyped)
sayRaw (Highlight.highlight _highlightBackend hinput)