Skip to content

Commit

Permalink
only output .debug.nockma file with the --debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira authored and lukaszcz committed Sep 9, 2024
1 parent ab2d31a commit 2dac769
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Commands/Compile/Anoma.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 2dac769

Please sign in to comment.