Skip to content

Commit

Permalink
Print file name when reporting error.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Nov 16, 2024
1 parent b510bae commit d240464
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Main where

import Ast
import Control.Monad (liftM, (<=<))
import Control.Monad (liftM, (<=<), zipWithM_)
import Data.List (sort)
import Data.Maybe (fromMaybe)
import Export
Expand Down Expand Up @@ -155,12 +155,12 @@ parsePaths = mapM parsePath
marshall :: [Judgement] -> Either Invalid [Judgement]
marshall = mapM (interpProps <=< checkPoints)

check :: [Judgement] -> IO ()
check js = do
check :: FilePath -> [Judgement] -> IO ()
check fname js = do
case marshall js of
-- Right newJs -> printJs newJs
Right _ -> return ()
Left e -> report $ reportInvalid e
Left e -> report $ fname <> ":\n" <> reportInvalid e

valid :: [Judgement] -> IO ()
valid js = do
Expand Down Expand Up @@ -453,7 +453,7 @@ main = do
CmdValid ->
with paths $ mapM_ valid
CmdCheck ->
with paths $ mapM_ check
with paths $ zipWithM_ check paths
CmdShow ->
with paths $ mapM_ printJs
CmdPending maybeDepth ->
Expand Down

0 comments on commit d240464

Please sign in to comment.