summaryrefslogtreecommitdiff
path: root/compiler/parser/Lexer.x
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-08-16 01:08:40 +0000
committerIan Lynagh <igloo@earth.li>2007-08-16 01:08:40 +0000
commitdd70a2da99ae6b09115ea80163d993e738c581fe (patch)
tree233adfba8a9cb7775abc3f796b887f4590ea4eca /compiler/parser/Lexer.x
parent26dc0aa6d3a06ee6b948a2827426407c7c8cda97 (diff)
downloadhaskell-dd70a2da99ae6b09115ea80163d993e738c581fe.tar.gz
Add a deprecated warning for _scc_
Diffstat (limited to 'compiler/parser/Lexer.x')
-rw-r--r--compiler/parser/Lexer.x14
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index 8ae3cd9435..1be9aa3443 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -28,7 +28,8 @@ module Lexer (
getMessages,
popContext, pushCurrentContext, setLastToken, setSrcLoc,
getLexState, popLexState, pushLexState,
- extension, standaloneDerivingEnabled, bangPatEnabled
+ extension, standaloneDerivingEnabled, bangPatEnabled,
+ addWarning
) where
#include "HsVersions.h"
@@ -1298,8 +1299,8 @@ getCharOrFail = do
-- Warnings
warn :: DynFlag -> SDoc -> Action
-warn option warning span _buf _len = do
- addWarning option (mkWarnMsg span alwaysQualify warning)
+warn option warning srcspan _buf _len = do
+ addWarning option srcspan warning
lexToken
-- -----------------------------------------------------------------------------
@@ -1581,10 +1582,11 @@ mkPState buf loc flags =
b `setBitIf` cond | cond = bit b
| otherwise = 0
-addWarning :: DynFlag -> WarnMsg -> P ()
-addWarning option w
+addWarning :: DynFlag -> SrcSpan -> SDoc -> P ()
+addWarning option srcspan warning
= P $ \s@PState{messages=(ws,es), dflags=d} ->
- let ws' = if dopt option d then ws `snocBag` w else ws
+ let warning' = mkWarnMsg srcspan alwaysQualify warning
+ ws' = if dopt option d then ws `snocBag` warning' else ws
in POk s{messages=(ws', es)} ()
getMessages :: PState -> Messages