summaryrefslogtreecommitdiff
path: root/testsuite/tests/quasiquotation
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-11-22 23:41:57 +0100
committerBen Gamari <ben@smart-cactus.org>2015-11-23 00:07:43 +0100
commit3df9563e590bbfbfe1bc9171a0e8fc93ceef690d (patch)
tree5e63328de5de41c66f089284d75e7251c4085db1 /testsuite/tests/quasiquotation
parent64737f2dfa0ff9ca4f4c056143b3591cedd32652 (diff)
downloadhaskell-3df9563e590bbfbfe1bc9171a0e8fc93ceef690d.tar.gz
ApiAnnotations: Make all RdrName occurences Located
At the moment the API Annotations can only be used on the ParsedSource, as there are changes made to the RenamedSource that prevent it from being used to round trip source code. It is possible to build a map from every Located Name in the RenamedSource from its location to the Name, which can then be used when resolved names are required when changing the ParsedSource. However, there are instances where the identifier is not located, specifically (GHC.VarPat name) (GHC.HsVar name) (GHC.UserTyVar name) (GHC.HsTyVar name) Replace each of the name types above with (Located name) Updates the haddock submodule. Test Plan: ./validate Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1512 GHC Trac Issues: #11019
Diffstat (limited to 'testsuite/tests/quasiquotation')
-rw-r--r--testsuite/tests/quasiquotation/T7918.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/tests/quasiquotation/T7918.hs b/testsuite/tests/quasiquotation/T7918.hs
index d549671b31..2d4577c963 100644
--- a/testsuite/tests/quasiquotation/T7918.hs
+++ b/testsuite/tests/quasiquotation/T7918.hs
@@ -29,19 +29,19 @@ traverse a =
gmapM traverse a
where
showVar :: Maybe (HsExpr Id) -> Traverse ()
- showVar (Just (HsVar v)) =
+ showVar (Just (HsVar (L _ v))) =
modify $ \(loc, ids) -> (loc, (varName v, loc) : ids)
showVar _ =
return ()
showTyVar :: Maybe (HsType Name) -> Traverse ()
- showTyVar (Just (HsTyVar v)) =
+ showTyVar (Just (HsTyVar (L _ v))) =
modify $ \(loc, ids) -> (loc, (v, loc) : ids)
showTyVar _ =
return ()
showPatVar :: Maybe (Pat Id) -> Traverse ()
- showPatVar (Just (VarPat v)) =
+ showPatVar (Just (VarPat (L _ v))) =
modify $ \(loc, ids) -> (loc, (varName v, loc) : ids)
showPatVar _
= return ()