config :: Parser Policy
config = do
    whiteSpace
    blks <- many1 defBlock
    eof
    st <- getState
    checkUnused (unused st)
    return $ Policy blks (iptbls st) (domtbls st)
  where
    iptbls = map makeIPTable . reverse . iplol
    domtbls = map makeDomainTable . reverse . domlol
    checkUnused [] = return ()
    checkUnused us = unexpected $ ": Not used -- " ++ concat (intersperse ", " us)

----------------------------------------------------------------
config :: Parser Policy
config = do
    whiteSpace
    blks <- many1 defBlock
    eof
    st <- getState
    checkUnused (unused st)
    return $ Policy blks (iptbls st) (domtbls st)
  where
    iptbls = map makeIPTable . reverse . iplol
    domtbls = map makeDomainTable . reverse . domlol
    checkUnused [] = return ()
    checkUnused us = unexpected $ ": Not used -- " ++ concat (intersperse ", " us)

----------------------------------------------------------------
config = do
    whiteSpace
    blks <- many1 defBlock
    eof
    st <- getState
    checkUnused (unused st)
    return $ Policy blks (iptbls st) (domtbls st)
  where
    iptbls = map makeIPTable . reverse . iplol
    domtbls = map makeDomainTable . reverse . domlol
    checkUnused [] = return ()
    checkUnused us = unexpected $ ": Not used -- " ++ concat (intersperse ", " us)

----------------------------------------------------------------