module DDC.Interface.Source
( Source(..)
, lineStartOfSource
, nameOfSource)
where
data Source
= SourceFile FilePath
| SourceArgs
| SourceConsole Int
| SourceBatch FilePath Int
deriving (Eq, Show)
lineStartOfSource :: Source -> Int
lineStartOfSource ss
= case ss of
SourceFile{} -> 1
SourceArgs{} -> 1
SourceConsole i -> i
SourceBatch _ i -> i
nameOfSource :: Source -> String
nameOfSource ss
= case ss of
SourceFile f -> f
SourceArgs -> "<arg>"
SourceConsole{} -> "<console>"
SourceBatch{} -> "<batch>"