diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-10-09 18:31:30 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-10-09 18:31:59 -0600 |
commit | 25a00d9dae44dd1fce00ba554db252ffafcd3d86 (patch) | |
tree | e0f0bb96775a3096355a4f4b9a083f017627b034 /Main.hs | |
parent | 9832f887e1772e1c0f546371584be323ae440fb8 (diff) | |
download | fiddle-25a00d9dae44dd1fce00ba554db252ffafcd3d86.tar.gz fiddle-25a00d9dae44dd1fce00ba554db252ffafcd3d86.tar.bz2 fiddle-25a00d9dae44dd1fce00ba554db252ffafcd3d86.zip |
CompilationPhases are categories.
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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." )) |