summaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Main.hs b/Main.hs
index 34ef997..97be0a3 100644
--- a/Main.hs
+++ b/Main.hs
@@ -20,10 +20,12 @@ import Options.Applicative
import qualified System.Environment as System
import System.Exit (exitWith)
import System.IO (stderr, hPutStrLn)
+import Control.Category ((>>>))
newtype IntermediateAst = IntermediateAst (GenericSyntaxTree Identity (Maybe Value))
deriving (Typeable)
+-- | The total compilation pipeline.
compilationPipeline ::
( FilePath ->
IO
@@ -50,6 +52,7 @@ compilationPipeline parse compile =
>>> (dumpPhase "qualified" >>> consistencyCheckPhase)
>>> dumpPhase "checked"
+-- | Compilation phase that just emits an ast artifact.
dumpPhase ::
forall stage.
( Typeable stage,
@@ -90,7 +93,7 @@ parseGlobalFlags :: Parser GlobalFlags
parseGlobalFlags =
GlobalFlags
<$> argument str (metavar "INPUT" <> help "Input file")
- <*> ((\b -> if b then jsonFormat else coloredFormat) <$> switch
+ <*> ((\b -> if b then jsonDiagnosticFormat else coloredFormat) <$> switch
( long "diagnostics-as-json"
<> help "Dump diagnostics in JSON format."
))