diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2015-01-15 13:11:21 -0600 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2015-01-23 07:17:34 -0600 |
commit | 3a7a30d765d272f10b150c28dcc28726b513b091 (patch) | |
tree | 7d90f90ff2058b76e6ed4d32476eff139dc25ec0 /testsuite | |
parent | 1f934a5b33bc154e5fbdfc79375b066511189908 (diff) | |
download | haskell-3a7a30d765d272f10b150c28dcc28726b513b091.tar.gz |
API Annotations tweaks.
Summary:
HsTyLit now has SourceText
Update documentation of HsSyn to reflect which annotations are attached to which element.
Ensure that the parser always keeps HsSCC and HsTickPragma values, to
be ignored in the desugar phase if not needed
Bringing in SourceText for pragmas
Add Location in NPlusKPat
Add Location in FunDep
Make RecCon payload Located
Explicitly add AnnVal to RdrName where it is compound
Add Location in IPBind
Add Location to name in IEThingAbs
Add Maybe (Located id,Bool) to Match to track fun_id,infix
This includes converting Match into a record and adding a note about why
the fun_id needs to be replicated in the Match.
Add Location in KindedTyVar
Sort out semi-colons for parsing
- import statements
- stmts
- decls
- decls_cls
- decls_inst
This updates the haddock submodule.
Test Plan: ./validate
Reviewers: hvr, austin, goldfire, simonpj
Reviewed By: simonpj
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D538
(cherry picked from commit 11881ec6f8d4db881671173441df87c2457409f4)
Diffstat (limited to 'testsuite')
5 files changed, 95 insertions, 53 deletions
diff --git a/testsuite/tests/ghc-api/annotations/AnnotationLet.hs b/testsuite/tests/ghc-api/annotations/AnnotationLet.hs index de30f8baaf..ad67b927f4 100644 --- a/testsuite/tests/ghc-api/annotations/AnnotationLet.hs +++ b/testsuite/tests/ghc-api/annotations/AnnotationLet.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeOperators #-} module AnnotationLet (foo) where { @@ -8,5 +9,9 @@ foo = let a _ = 2 b = 2 in a b - +; +infixr 8 + +; +data ((f + g)) a = InL (f a) | InR (g a) +; } diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 821aaa06ac..421154ea25 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -4,6 +4,7 @@ include $(TOP)/mk/test.mk clean: rm -f *.o *.hi + rm -f annotations comments parseTree annotations: rm -f annotations.o annotations.hi diff --git a/testsuite/tests/ghc-api/annotations/annotations.stdout b/testsuite/tests/ghc-api/annotations/annotations.stdout index 2142674f9b..e465403483 100644 --- a/testsuite/tests/ghc-api/annotations/annotations.stdout +++ b/testsuite/tests/ghc-api/annotations/annotations.stdout @@ -1,41 +1,35 @@ [ -(AK AnnotationLet.hs:1:1 AnnClose = [AnnotationLet.hs:12:1]) +(AK AnnotationLet.hs:1:1 AnnCloseC = [AnnotationLet.hs:17:1]) -(AK AnnotationLet.hs:1:1 AnnModule = [AnnotationLet.hs:1:1-6]) +(AK AnnotationLet.hs:1:1 AnnModule = [AnnotationLet.hs:2:1-6]) -(AK AnnotationLet.hs:1:1 AnnOpen = [AnnotationLet.hs:3:1]) +(AK AnnotationLet.hs:1:1 AnnOpenC = [AnnotationLet.hs:4:1]) -(AK AnnotationLet.hs:1:1 AnnSemi = [AnnotationLet.hs:5:1]) +(AK AnnotationLet.hs:1:1 AnnWhere = [AnnotationLet.hs:2:28-32]) -(AK AnnotationLet.hs:1:1 AnnWhere = [AnnotationLet.hs:1:28-32]) +(AK AnnotationLet.hs:2:22-26 AnnCloseP = [AnnotationLet.hs:2:26]) -(AK AnnotationLet.hs:1:22-26 AnnClose = [AnnotationLet.hs:1:26]) +(AK AnnotationLet.hs:2:22-26 AnnOpenP = [AnnotationLet.hs:2:22]) -(AK AnnotationLet.hs:1:22-26 AnnOpen = [AnnotationLet.hs:1:22]) +(AK AnnotationLet.hs:5:1-32 AnnAs = [AnnotationLet.hs:5:28-29]) -(AK AnnotationLet.hs:1:23-25 AnnVal = [AnnotationLet.hs:1:23-25]) +(AK AnnotationLet.hs:5:1-32 AnnImport = [AnnotationLet.hs:5:1-6]) -(AK AnnotationLet.hs:4:1-32 AnnAs = [AnnotationLet.hs:4:28-29]) +(AK AnnotationLet.hs:5:1-32 AnnQualified = [AnnotationLet.hs:5:8-16]) -(AK AnnotationLet.hs:4:1-32 AnnImport = [AnnotationLet.hs:4:1-6]) +(AK AnnotationLet.hs:5:1-32 AnnSemi = [AnnotationLet.hs:6:1]) -(AK AnnotationLet.hs:4:1-32 AnnQualified = [AnnotationLet.hs:4:8-16]) +(AK AnnotationLet.hs:5:1-32 AnnVal = [AnnotationLet.hs:5:31-32]) -(AK AnnotationLet.hs:4:1-32 AnnVal = [AnnotationLet.hs:4:31-32]) +(AK AnnotationLet.hs:(7,1)-(11,12) AnnEqual = [AnnotationLet.hs:7:5]) -(AK AnnotationLet.hs:(6,1)-(10,12) AnnEqual = [AnnotationLet.hs:6:5]) +(AK AnnotationLet.hs:(7,1)-(11,12) AnnFunId = [AnnotationLet.hs:7:1-3]) -(AK AnnotationLet.hs:(6,1)-(10,12) AnnFunId = [AnnotationLet.hs:6:1-3]) +(AK AnnotationLet.hs:(7,1)-(11,12) AnnSemi = [AnnotationLet.hs:12:1]) -(AK AnnotationLet.hs:(6,7)-(10,12) AnnIn = [AnnotationLet.hs:10:7-8]) +(AK AnnotationLet.hs:(7,7)-(11,12) AnnIn = [AnnotationLet.hs:11:7-8]) -(AK AnnotationLet.hs:(6,7)-(10,12) AnnLet = [AnnotationLet.hs:6:7-9]) - -(AK AnnotationLet.hs:7:9-15 AnnEqual = [AnnotationLet.hs:7:13]) - -(AK AnnotationLet.hs:7:9-15 AnnFunId = [AnnotationLet.hs:7:9]) - -(AK AnnotationLet.hs:7:9-15 AnnSemi = [AnnotationLet.hs:8:9]) +(AK AnnotationLet.hs:(7,7)-(11,12) AnnLet = [AnnotationLet.hs:7:7-9]) (AK AnnotationLet.hs:8:9-15 AnnEqual = [AnnotationLet.hs:8:13]) @@ -43,13 +37,53 @@ (AK AnnotationLet.hs:8:9-15 AnnSemi = [AnnotationLet.hs:9:9]) -(AK AnnotationLet.hs:9:9-13 AnnEqual = [AnnotationLet.hs:9:11]) +(AK AnnotationLet.hs:9:9-15 AnnEqual = [AnnotationLet.hs:9:13]) + +(AK AnnotationLet.hs:9:9-15 AnnFunId = [AnnotationLet.hs:9:9]) + +(AK AnnotationLet.hs:9:9-15 AnnSemi = [AnnotationLet.hs:10:9]) + +(AK AnnotationLet.hs:10:9-13 AnnEqual = [AnnotationLet.hs:10:11]) + +(AK AnnotationLet.hs:10:9-13 AnnFunId = [AnnotationLet.hs:10:9]) + +(AK AnnotationLet.hs:13:1-10 AnnInfix = [AnnotationLet.hs:13:1-6]) + +(AK AnnotationLet.hs:13:1-10 AnnSemi = [AnnotationLet.hs:14:1]) + +(AK AnnotationLet.hs:13:1-10 AnnVal = [AnnotationLet.hs:13:8]) + +(AK AnnotationLet.hs:15:1-40 AnnCloseP = [AnnotationLet.hs:15:14, AnnotationLet.hs:15:13]) + +(AK AnnotationLet.hs:15:1-40 AnnData = [AnnotationLet.hs:15:1-4]) + +(AK AnnotationLet.hs:15:1-40 AnnEqual = [AnnotationLet.hs:15:18]) + +(AK AnnotationLet.hs:15:1-40 AnnOpenP = [AnnotationLet.hs:15:6, AnnotationLet.hs:15:7]) + +(AK AnnotationLet.hs:15:1-40 AnnSemi = [AnnotationLet.hs:16:1]) + +(AK AnnotationLet.hs:15:6-14 AnnCloseP = [AnnotationLet.hs:15:14]) + +(AK AnnotationLet.hs:15:6-14 AnnOpenP = [AnnotationLet.hs:15:6]) + +(AK AnnotationLet.hs:15:7-13 AnnCloseP = [AnnotationLet.hs:15:13]) + +(AK AnnotationLet.hs:15:7-13 AnnOpenP = [AnnotationLet.hs:15:7]) + +(AK AnnotationLet.hs:15:20-28 AnnVbar = [AnnotationLet.hs:15:30]) + +(AK AnnotationLet.hs:15:24-28 AnnCloseP = [AnnotationLet.hs:15:28]) + +(AK AnnotationLet.hs:15:24-28 AnnOpenP = [AnnotationLet.hs:15:24]) + +(AK AnnotationLet.hs:15:36-40 AnnCloseP = [AnnotationLet.hs:15:40]) -(AK AnnotationLet.hs:9:9-13 AnnFunId = [AnnotationLet.hs:9:9]) +(AK AnnotationLet.hs:15:36-40 AnnOpenP = [AnnotationLet.hs:15:36]) -(AK <no location info> AnnEofPos = [AnnotationLet.hs:13:1]) +(AK <no location info> AnnEofPos = [AnnotationLet.hs:18:1]) ] -[AnnotationLet.hs:1:1-6] +[AnnotationLet.hs:2:1-6] [] AnnotationLet.hs:1:1 diff --git a/testsuite/tests/ghc-api/annotations/parseTree.stdout b/testsuite/tests/ghc-api/annotations/parseTree.stdout index cf8b82e029..0638608c6b 100644 --- a/testsuite/tests/ghc-api/annotations/parseTree.stdout +++ b/testsuite/tests/ghc-api/annotations/parseTree.stdout @@ -11,21 +11,17 @@ (AnnotationTuple.hs:15:25, [m], ()), (AnnotationTuple.hs:15:26, [m], ())] [ -(AK AnnotationTuple.hs:1:1 AnnClose = [AnnotationTuple.hs:16:1]) +(AK AnnotationTuple.hs:1:1 AnnCloseC = [AnnotationTuple.hs:16:1]) (AK AnnotationTuple.hs:1:1 AnnModule = [AnnotationTuple.hs:2:1-6]) -(AK AnnotationTuple.hs:1:1 AnnOpen = [AnnotationTuple.hs:4:1]) - -(AK AnnotationTuple.hs:1:1 AnnSemi = [AnnotationTuple.hs:6:1]) +(AK AnnotationTuple.hs:1:1 AnnOpenC = [AnnotationTuple.hs:4:1]) (AK AnnotationTuple.hs:1:1 AnnWhere = [AnnotationTuple.hs:2:30-34]) -(AK AnnotationTuple.hs:2:24-28 AnnClose = [AnnotationTuple.hs:2:28]) - -(AK AnnotationTuple.hs:2:24-28 AnnOpen = [AnnotationTuple.hs:2:24]) +(AK AnnotationTuple.hs:2:24-28 AnnCloseP = [AnnotationTuple.hs:2:28]) -(AK AnnotationTuple.hs:2:25-27 AnnVal = [AnnotationTuple.hs:2:25-27]) +(AK AnnotationTuple.hs:2:24-28 AnnOpenP = [AnnotationTuple.hs:2:24]) (AK AnnotationTuple.hs:5:1-32 AnnAs = [AnnotationTuple.hs:5:28-29]) @@ -33,6 +29,8 @@ (AK AnnotationTuple.hs:5:1-32 AnnQualified = [AnnotationTuple.hs:5:8-16]) +(AK AnnotationTuple.hs:5:1-32 AnnSemi = [AnnotationTuple.hs:6:1]) + (AK AnnotationTuple.hs:5:1-32 AnnVal = [AnnotationTuple.hs:5:31-32]) (AK AnnotationTuple.hs:(7,1)-(10,14) AnnEqual = [AnnotationTuple.hs:7:5]) @@ -55,15 +53,19 @@ (AK AnnotationTuple.hs:9:9-13 AnnFunId = [AnnotationTuple.hs:9:9]) +(AK AnnotationTuple.hs:10:10-14 AnnVal = [AnnotationTuple.hs:10:12]) + (AK AnnotationTuple.hs:13:1-72 AnnEqual = [AnnotationTuple.hs:13:5]) (AK AnnotationTuple.hs:13:1-72 AnnFunId = [AnnotationTuple.hs:13:1-3]) (AK AnnotationTuple.hs:13:1-72 AnnSemi = [AnnotationTuple.hs:14:1]) -(AK AnnotationTuple.hs:13:19-53 AnnClose = [AnnotationTuple.hs:13:53]) +(AK AnnotationTuple.hs:13:7-72 AnnVal = [AnnotationTuple.hs:13:13]) + +(AK AnnotationTuple.hs:13:19-53 AnnCloseP = [AnnotationTuple.hs:13:53]) -(AK AnnotationTuple.hs:13:19-53 AnnOpen = [AnnotationTuple.hs:13:19]) +(AK AnnotationTuple.hs:13:19-53 AnnOpenP = [AnnotationTuple.hs:13:19]) (AK AnnotationTuple.hs:13:20 AnnComma = [AnnotationTuple.hs:13:21]) @@ -73,9 +75,9 @@ (AK AnnotationTuple.hs:13:39 AnnComma = [AnnotationTuple.hs:13:39]) -(AK AnnotationTuple.hs:13:41-52 AnnClose = [AnnotationTuple.hs:13:52]) +(AK AnnotationTuple.hs:13:41-52 AnnCloseS = [AnnotationTuple.hs:13:52]) -(AK AnnotationTuple.hs:13:41-52 AnnOpen = [AnnotationTuple.hs:13:41]) +(AK AnnotationTuple.hs:13:41-52 AnnOpenS = [AnnotationTuple.hs:13:41]) (AK AnnotationTuple.hs:13:42 AnnComma = [AnnotationTuple.hs:13:43]) @@ -83,23 +85,23 @@ (AK AnnotationTuple.hs:13:48 AnnComma = [AnnotationTuple.hs:13:49]) -(AK AnnotationTuple.hs:13:55-72 AnnClose = [AnnotationTuple.hs:13:72]) +(AK AnnotationTuple.hs:13:55-72 AnnCloseS = [AnnotationTuple.hs:13:72]) -(AK AnnotationTuple.hs:13:55-72 AnnOpen = [AnnotationTuple.hs:13:55]) +(AK AnnotationTuple.hs:13:55-72 AnnOpenS = [AnnotationTuple.hs:13:55]) (AK AnnotationTuple.hs:13:56-62 AnnComma = [AnnotationTuple.hs:13:63]) -(AK AnnotationTuple.hs:13:61-62 AnnClose = [AnnotationTuple.hs:13:62]) +(AK AnnotationTuple.hs:13:61-62 AnnCloseP = [AnnotationTuple.hs:13:62]) -(AK AnnotationTuple.hs:13:61-62 AnnOpen = [AnnotationTuple.hs:13:61]) +(AK AnnotationTuple.hs:13:61-62 AnnOpenP = [AnnotationTuple.hs:13:61]) (AK AnnotationTuple.hs:15:1-41 AnnEqual = [AnnotationTuple.hs:15:5]) (AK AnnotationTuple.hs:15:1-41 AnnFunId = [AnnotationTuple.hs:15:1-3]) -(AK AnnotationTuple.hs:15:7-27 AnnClose = [AnnotationTuple.hs:15:27]) +(AK AnnotationTuple.hs:15:7-27 AnnCloseP = [AnnotationTuple.hs:15:27]) -(AK AnnotationTuple.hs:15:7-27 AnnOpen = [AnnotationTuple.hs:15:7]) +(AK AnnotationTuple.hs:15:7-27 AnnOpenP = [AnnotationTuple.hs:15:7]) (AK AnnotationTuple.hs:15:8 AnnComma = [AnnotationTuple.hs:15:9]) @@ -113,13 +115,13 @@ (AK AnnotationTuple.hs:15:26 AnnComma = [AnnotationTuple.hs:15:26]) -(AK AnnotationTuple.hs:15:33-41 AnnClose = [AnnotationTuple.hs:15:41]) +(AK AnnotationTuple.hs:15:33-41 AnnCloseP = [AnnotationTuple.hs:15:41]) -(AK AnnotationTuple.hs:15:33-41 AnnOpen = [AnnotationTuple.hs:15:33]) +(AK AnnotationTuple.hs:15:33-41 AnnOpenP = [AnnotationTuple.hs:15:33]) -(AK AnnotationTuple.hs:15:39-40 AnnClose = [AnnotationTuple.hs:15:40]) +(AK AnnotationTuple.hs:15:39-40 AnnCloseP = [AnnotationTuple.hs:15:40]) -(AK AnnotationTuple.hs:15:39-40 AnnOpen = [AnnotationTuple.hs:15:39]) +(AK AnnotationTuple.hs:15:39-40 AnnOpenP = [AnnotationTuple.hs:15:39]) (AK <no location info> AnnEofPos = [AnnotationTuple.hs:21:1]) ] diff --git a/testsuite/tests/ghc-api/landmines/landmines.stdout b/testsuite/tests/ghc-api/landmines/landmines.stdout index 5d9fd71ea2..fc538141bb 100644 --- a/testsuite/tests/ghc-api/landmines/landmines.stdout +++ b/testsuite/tests/ghc-api/landmines/landmines.stdout @@ -1,4 +1,4 @@ -(9,9,6) -(46,42,0) -(11,10,6) -(7,7,6) +(10,9,6) +(49,45,0) +(12,10,6) +(8,7,6) |