Files
xmonad/tests/loc.hs
Ferenc Wagner 42dde26d4d The empty line isntcomment.
There is a separate filter for that case.
2007-10-06 19:12:31 +00:00

15 lines
483 B
Haskell

import Control.Monad
import System.Exit
main = do foo <- getContents
let actual_loc = filter (not.null) $ filter isntcomment $
map (dropWhile (==' ')) $ lines foo
loc = length actual_loc
putStrLn $ show loc
-- uncomment the following to check for mistakes in isntcomment
-- putStr $ unlines $ actual_loc
isntcomment ('-':'-':_) = False
isntcomment ('{':'-':_) = False -- pragmas
isntcomment _ = True