blob: 3edc60bb581147366df5688cd29630bc1d4c07f6 (
plain) (
tree)
|
|
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
isntcomment ('{':'-':_) = False -- pragmas
isntcomment _ = True
|