mirror of
https://github.com/anoma/juvix.git
synced 2024-12-03 09:41:10 +03:00
Only output .debug.nockma file with the --debug flag (#3006)
This commit is contained in:
parent
ab2d31a313
commit
372375ef4d
@ -23,11 +23,11 @@ runCommand opts = do
|
||||
$ coreRes
|
||||
^. coreResultModule
|
||||
res <- getRight r
|
||||
outputAnomaResult nockmaFile res
|
||||
outputAnomaResult (opts' ^. compileDebug) nockmaFile res
|
||||
|
||||
outputAnomaResult :: (Members '[EmbedIO, App] r) => Path Abs File -> Nockma.AnomaResult -> Sem r ()
|
||||
outputAnomaResult nockmaFile Nockma.AnomaResult {..} = do
|
||||
outputAnomaResult :: (Members '[EmbedIO, App] r) => Bool -> Path Abs File -> Nockma.AnomaResult -> Sem r ()
|
||||
outputAnomaResult debugOutput nockmaFile Nockma.AnomaResult {..} = do
|
||||
let code = Nockma.ppSerialize _anomaClosure
|
||||
prettyNockmaFile = replaceExtensions' [".pretty", ".nockma"] nockmaFile
|
||||
prettyNockmaFile = replaceExtensions' [".debug", ".nockma"] nockmaFile
|
||||
writeFileEnsureLn nockmaFile code
|
||||
writeFileEnsureLn prettyNockmaFile (Nockma.ppPrint _anomaClosure)
|
||||
when debugOutput (writeFileEnsureLn prettyNockmaFile (Nockma.ppPrint _anomaClosure))
|
||||
|
Loading…
Reference in New Issue
Block a user