Various API Annotations fixes
authorAlan Zimmerman <alan.zimm@gmail.com>
Wed, 30 Dec 2015 16:51:53 +0000 (18:51 +0200)
committerHerbert Valerio Riedel <hvr@gnu.org>
Fri, 1 Jan 2016 15:42:59 +0000 (16:42 +0100)
- Export unicodeAnn from GHC
- unicodeAnn for Annlarrowtail was wrong
- Use actual source for a CImport SourceText

(cherry picked from commit 25e4556d97429e95ddb5972f6e7e6599ef902e9c)

compiler/main/GHC.hs
compiler/parser/ApiAnnotation.hs
compiler/parser/RdrHsSyn.hs
testsuite/tests/ghc-api/annotations/T11018.stdout

index 0ac1331..666ff49 100644 (file)
@@ -272,6 +272,7 @@ module GHC (
         ApiAnns,AnnKeywordId(..),AnnotationComment(..),
         getAnnotation, getAndRemoveAnnotation,
         getAnnotationComments, getAndRemoveAnnotationComments,
+        unicodeAnn,
 
         -- * Miscellaneous
         --sessionHscEnv,
index b5214c1..73490e4 100644 (file)
@@ -324,7 +324,7 @@ unicodeAnn AnnDcolon     = AnnDcolonU
 unicodeAnn AnnLarrow     = AnnLarrowU
 unicodeAnn AnnRarrow     = AnnRarrowU
 unicodeAnn AnnDarrow     = AnnDarrowU
-unicodeAnn Annlarrowtail = AnnLarrowtailU
+unicodeAnn Annlarrowtail = AnnlarrowtailU
 unicodeAnn Annrarrowtail = AnnrarrowtailU
 unicodeAnn AnnLarrowtail = AnnLarrowtailU
 unicodeAnn AnnRarrowtail = AnnRarrowtailU
index f423c6e..0f38086 100644 (file)
@@ -1268,7 +1268,7 @@ mkImport (L lc cconv) (L ls safety) (L loc (StringLiteral esrc entity), v, ty)
   | cconv == PrimCallConv                      = do
   let funcTarget = CFunction (StaticTarget esrc entity Nothing True)
       importSpec = CImport (L lc PrimCallConv) (L ls safety) Nothing funcTarget
-                           (L loc (unpackFS entity))
+                           (L loc esrc)
   return (ForD (ForeignImport { fd_name = v, fd_sig_ty = ty
                               , fd_co = noForeignImportCoercionYet
                               , fd_fi = importSpec }))
index ac32549..011867e 100644 (file)
 ((Test11018.hs:43:11-17,AnnOpenP), [Test11018.hs:43:11]),
 ((Test11018.hs:43:12,AnnComma), [Test11018.hs:43:13]),
 ((Test11018.hs:43:14,AnnComma), [Test11018.hs:43:15]),
-((Test11018.hs:43:22-34,AnnLarrowtailU), [Test11018.hs:43:30]),
+((Test11018.hs:43:22-34,AnnlarrowtailU), [Test11018.hs:43:30]),
 ((Test11018.hs:43:32-34,AnnVal), [Test11018.hs:43:33]),
 ((Test11018.hs:45:1-36,AnnDcolon), [Test11018.hs:45:5-6]),
 ((Test11018.hs:45:1-36,AnnSemi), [Test11018.hs:46:1]),