Skip to content

Commit

Permalink
Do not elaborate format (thanks @byorgey)
Browse files Browse the repository at this point in the history
  • Loading branch information
xsebek committed Aug 24, 2023
1 parent 503f38b commit 41527ea
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import Options.Applicative
import Swarm.App (appMain)
import Swarm.Doc.Gen (EditorType (..), GenerateDocs (..), PageAddress (..), SheetType (..), generateDocs)
import Swarm.Language.LSP (lspMain)
import Swarm.Language.Module (Module (..))
import Swarm.Language.Pipeline (ProcessedTerm (..), processTerm)
import Swarm.Language.Parse (readTerm)
import Swarm.Language.Pretty (prettyText)
import Swarm.TUI.Model (AppOpts (..), ColorMode (..))
import Swarm.TUI.Model.UI (defaultInitLgTicksPerSecond)
Expand Down Expand Up @@ -162,12 +161,11 @@ showInput (File fp) = pack fp
formatFile :: Input -> IO ()
formatFile input = do
content <- getInput input
case processTerm content of
case readTerm content of
Right t -> do
case t of
Nothing -> Text.putStrLn ""
Just (ProcessedTerm (Module ast _mctx) _req _ctx) ->
Text.putStrLn $ prettyText ast
Just ast -> Text.putStrLn $ prettyText ast
exitSuccess
Left e -> do
Text.hPutStrLn stderr $ showInput input <> ":" <> e
Expand Down

0 comments on commit 41527ea

Please sign in to comment.