summaryrefslogtreecommitdiff
path: root/compiler/main/CmdLineParser.hs
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-10-17 13:49:48 -0700
committerDavid Terei <davidterei@gmail.com>2011-10-17 13:50:07 -0700
commit6f43ec8ca0e4edfe9b449e3df10f01d5d3d36331 (patch)
tree7cc0a7d6f4dd8fd80b499f7f7ee7b1f1f6cfe838 /compiler/main/CmdLineParser.hs
parentc532c16ff5c93ea5330da4e81b2171d2f20e0653 (diff)
downloadhaskell-6f43ec8ca0e4edfe9b449e3df10f01d5d3d36331.tar.gz
Fix safe haskell warnings to include src locations
Diffstat (limited to 'compiler/main/CmdLineParser.hs')
-rw-r--r--compiler/main/CmdLineParser.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index 9fe238122b..c4bfe3abe7 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -15,7 +15,7 @@ module CmdLineParser (
Flag(..),
errorsToGhcException,
- EwM, addErr, addWarn, getArg, liftEwM, deprecate
+ EwM, addErr, addWarn, getArg, getCurLoc, liftEwM, deprecate
) where
#include "HsVersions.h"
@@ -91,6 +91,9 @@ deprecate s
getArg :: Monad m => EwM m String
getArg = EwM (\(L _ arg) es ws -> return (es, ws, arg))
+getCurLoc :: Monad m => EwM m SrcSpan
+getCurLoc = EwM (\(L loc _) es ws -> return (es, ws, loc))
+
liftEwM :: Monad m => m a -> EwM m a
liftEwM action = EwM (\_ es ws -> do { r <- action; return (es, ws, r) })