diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2015-11-13 08:39:07 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2015-11-13 08:39:07 +0200 |
commit | 2290c8bd8c3faee0cb7dc1c2c7951bb9d5e3ebf9 (patch) | |
tree | ede1496a88c095fb62431a21c2384b25647c1504 /testsuite/tests | |
parent | 5d6133bec0f682e86ee31bbdb6d82e6fb2ede8f7 (diff) | |
download | haskell-2290c8bd8c3faee0cb7dc1c2c7951bb9d5e3ebf9.tar.gz |
APIAnnotations:add Locations in hsSyn for layout
Summary:
At the moment ghc-exactprint, which uses the GHC API Annotations to
provide a framework for roundtripping Haskell source code with optional
AST edits, has to implement a horrible workaround to manage the points
where layout needs to be captured.
These are
MatchGroup
HsDo
HsCmdDo
HsLet
LetStmt
HsCmdLet
GRHSs
To provide a more natural representation, the contents subject to layout
rules need to be wrapped in a SrcSpan.
This commit does this.
Trac ticket #10250
Test Plan: ./validate
Reviewers: hvr, goldfire, bgamari, austin, mpickering
Reviewed By: mpickering
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D1370
GHC Trac Issues: #10250
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ghc-api/T6145.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/listcomps.stdout | 10 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/landmines/landmines.stdout | 6 |
3 files changed, 10 insertions, 8 deletions
diff --git a/testsuite/tests/ghc-api/T6145.hs b/testsuite/tests/ghc-api/T6145.hs index 13b80eef87..58a4f9b7d5 100644 --- a/testsuite/tests/ghc-api/T6145.hs +++ b/testsuite/tests/ghc-api/T6145.hs @@ -35,7 +35,7 @@ main = do isDataCon (L _ (AbsBinds { abs_binds = bs })) = not (isEmptyBag (filterBag isDataCon bs)) isDataCon (L l (f@FunBind {})) - | (MG (m:_) _ _ _) <- fun_matches f, + | (MG (L _ (m:_)) _ _ _) <- fun_matches f, (L _ (c@ConPatOut{}):_)<-hsLMatchPats m, (L l _)<-pat_con c = isGoodSrcSpan l -- Check that the source location is a good one diff --git a/testsuite/tests/ghc-api/annotations/listcomps.stdout b/testsuite/tests/ghc-api/annotations/listcomps.stdout index 081258a5cf..1c0b8e5ce4 100644 --- a/testsuite/tests/ghc-api/annotations/listcomps.stdout +++ b/testsuite/tests/ghc-api/annotations/listcomps.stdout @@ -12,9 +12,10 @@ ListComprehensions.hs:(18,18)-(22,20), ListComprehensions.hs:(18,20)-(22,20), ListComprehensions.hs:18:22, ListComprehensions.hs:18:22-26, ListComprehensions.hs:18:22-30, - ListComprehensions.hs:18:24, ListComprehensions.hs:18:26, - ListComprehensions.hs:18:28, ListComprehensions.hs:18:30, - ListComprehensions.hs:19:22, ListComprehensions.hs:19:22-33, + ListComprehensions.hs:(18,22)-(21,34), ListComprehensions.hs:18:24, + ListComprehensions.hs:18:26, ListComprehensions.hs:18:28, + ListComprehensions.hs:18:30, ListComprehensions.hs:19:22, + ListComprehensions.hs:19:22-33, ListComprehensions.hs:(19,22)-(21,34), ListComprehensions.hs:19:27-33, ListComprehensions.hs:19:28, ListComprehensions.hs:19:31-32, ListComprehensions.hs:20:22, @@ -30,7 +31,8 @@ ListComprehensions.hs:25:8-10, ListComprehensions.hs:(25,12)-(28,14), ListComprehensions.hs:(25,14)-(28,14), - ListComprehensions.hs:25:16-20, ListComprehensions.hs:26:16, + ListComprehensions.hs:25:16-20, + ListComprehensions.hs:(25,16)-(27,22), ListComprehensions.hs:26:16, ListComprehensions.hs:26:16-23, ListComprehensions.hs:(26,16)-(27,22), ListComprehensions.hs:26:21-23, ListComprehensions.hs:27:21-22, diff --git a/testsuite/tests/ghc-api/landmines/landmines.stdout b/testsuite/tests/ghc-api/landmines/landmines.stdout index 7d667ed6f8..bddb1be992 100644 --- a/testsuite/tests/ghc-api/landmines/landmines.stdout +++ b/testsuite/tests/ghc-api/landmines/landmines.stdout @@ -1,4 +1,4 @@ -(10,10,6) +(11,11,7) (49,45,0) -(12,11,6) -(8,8,6) +(13,12,7) +(9,9,7) |