[commit: ghc] master: Make SCCFunSig tag Located for ghc-exactprint (9b859ef)

git at git.haskell.org git at git.haskell.org
Fri Feb 24 16:59:47 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9b859ef0077972e8e37e29c546bf587fd9f65e4c/ghc

>---------------------------------------------------------------

commit 9b859ef0077972e8e37e29c546bf587fd9f65e4c
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Fri Feb 24 18:57:51 2017 +0200

    Make SCCFunSig tag Located for ghc-exactprint


>---------------------------------------------------------------

9b859ef0077972e8e37e29c546bf587fd9f65e4c
 compiler/hsSyn/HsBinds.hs     | 2 +-
 compiler/parser/Parser.y      | 2 +-
 compiler/typecheck/TcBinds.hs | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs
index 1f38c38..d985082 100644
--- a/compiler/hsSyn/HsBinds.hs
+++ b/compiler/hsSyn/HsBinds.hs
@@ -852,7 +852,7 @@ data Sig name
 
   | SCCFunSig  SourceText      -- Note [Pragma source text] in BasicTypes
                (Located name)  -- Function name
-               (Maybe StringLiteral)
+               (Maybe (Located StringLiteral))
   | CompleteMatchSig SourceText (Located [Located name]) (Maybe (Located name))
 
 deriving instance (DataId name) => Data (Sig name)
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index 92e3232..c6a8e48 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2275,7 +2275,7 @@ sigdecl :: { LHsDecl RdrName }
         | '{-# SCC' qvar STRING '#-}'
           {% do { scc <- getSCC $3
                 ; let str_lit = StringLiteral (getSTRINGs $3) scc
-                ; ams (sLL $1 $> (SigD (SCCFunSig (getSCC_PRAGs $1) $2 (Just str_lit))))
+                ; ams (sLL $1 $> (SigD (SCCFunSig (getSCC_PRAGs $1) $2 (Just ( sL1 $3 str_lit)))))
                       [mo $1, mc $4] } }
 
         | '{-# SPECIALISE' activation qvar '::' sigtypes1 '#-}'
diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs
index 25c4061..5586abe 100644
--- a/compiler/typecheck/TcBinds.hs
+++ b/compiler/typecheck/TcBinds.hs
@@ -727,7 +727,7 @@ funBindTicks loc fun_id mod sigs
       -- by the renamer
   , let cc_str
           | Just cc_str <- mb_cc_str
-          = sl_fs cc_str
+          = sl_fs $ unLoc cc_str
           | otherwise
           = getOccFS (Var.varName fun_id)
         cc_name = moduleNameFS (moduleName mod) `appendFS` consFS '.' cc_str



More information about the ghc-commits mailing list