summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2021-10-02 03:15:14 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-04 23:46:21 -0400
commita762933454f1dbecaa2048f810f6ab6bbfe3a93d (patch)
tree05d54919ee3e2ccddb1b4ddce580afee479b620d /testsuite/tests/parser
parenta0f44cebb217b3586d861750366301b973073dd1 (diff)
downloadhaskell-a762933454f1dbecaa2048f810f6ab6bbfe3a93d.tar.gz
Bespoke TokenLocation data type
The EpaAnnCO we were using contained an Anchor instead of EpaLocation, making it harder to work with. At the same time, using EpaLocation by itself isn't possible either, as we may have tokens without location information. Hence the new data type: data TokenLocation = NoTokenLoc | TokenLoc !EpaLocation
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r--testsuite/tests/parser/should_compile/DumpParsedAst.stderr17
-rw-r--r--testsuite/tests/parser/should_compile/DumpRenamedAst.stderr80
-rw-r--r--testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr40
-rw-r--r--testsuite/tests/parser/should_compile/KindSigs.stderr18
-rw-r--r--testsuite/tests/parser/should_compile/T14189.stderr4
5 files changed, 52 insertions, 107 deletions
diff --git a/testsuite/tests/parser/should_compile/DumpParsedAst.stderr b/testsuite/tests/parser/should_compile/DumpParsedAst.stderr
index faf63b8a90..d68daf6738 100644
--- a/testsuite/tests/parser/should_compile/DumpParsedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpParsedAst.stderr
@@ -146,10 +146,10 @@
(HsLinearArrow
(HsPct1
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsNormalTok))))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAst.hs:8:26-30 })
@@ -556,10 +556,10 @@
(HsLinearArrow
(HsPct1
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsNormalTok))))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAst.hs:15:25-29 })
@@ -846,13 +846,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpParsedAst.hs:17:33-34 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpParsedAst.hs:17:33-34 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAst.hs:17:31 })
diff --git a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
index 66ff512a53..84519126fc 100644
--- a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
@@ -151,10 +151,10 @@
(HsLinearArrow
(HsPct1
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsNormalTok))))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:10:26-30 })
@@ -386,13 +386,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:16:22-23 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:16:22-23 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:16:20 })
@@ -414,13 +409,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:16:27-28 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:16:27-28 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:16:25 })
@@ -496,13 +486,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:19:30-31 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:19:30-31 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:19:28 })
@@ -539,13 +524,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:19:54-55 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:19:54-55 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:19:42-52 })
@@ -563,13 +543,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:19:45-46 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:19:45-46 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:19:43 })
@@ -612,13 +587,8 @@
[(HsScaled
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:20:36-37 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:20:36-37 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnn
@@ -663,13 +633,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:20:27-28 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:20:27-28 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:20:22-25 })
@@ -828,10 +793,10 @@
(HsLinearArrow
(HsPct1
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsNormalTok))))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:22:25-29 })
@@ -1020,13 +985,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { DumpRenamedAst.hs:24:33-34 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { DumpRenamedAst.hs:24:33-34 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpRenamedAst.hs:24:31 })
diff --git a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
index addb3d0ff2..55c10d4729 100644
--- a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
@@ -108,7 +108,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -141,7 +141,7 @@
(NoSourceText)
"T")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -268,7 +268,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -301,7 +301,7 @@
(NoSourceText)
"'MkT")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -428,7 +428,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -461,7 +461,7 @@
(NoSourceText)
"Peano")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -588,7 +588,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -621,7 +621,7 @@
(NoSourceText)
"'Zero")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -748,7 +748,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -781,7 +781,7 @@
(NoSourceText)
"'Succ")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1190,7 +1190,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1238,7 +1238,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1286,7 +1286,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1344,13 +1344,13 @@
[]
[]))))))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))))
,(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1442,7 +1442,7 @@
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1475,14 +1475,14 @@
(NoSourceText)
"main")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
(HsPar
(EpAnnNotUsed)
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
(SrcSpanAnn (EpAnnNotUsed) { <no location info> })
@@ -1515,7 +1515,7 @@
(NoSourceText)
"DumpTypecheckedAst")))))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))))))))
,(L
(SrcSpanAnn (EpAnnNotUsed) { DumpTypecheckedAst.hs:19:1-23 })
diff --git a/testsuite/tests/parser/should_compile/KindSigs.stderr b/testsuite/tests/parser/should_compile/KindSigs.stderr
index 66d76ca683..a8914e9c78 100644
--- a/testsuite/tests/parser/should_compile/KindSigs.stderr
+++ b/testsuite/tests/parser/should_compile/KindSigs.stderr
@@ -684,13 +684,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { KindSigs.hs:22:22-23 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { KindSigs.hs:22:22-23 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { KindSigs.hs:22:8-20 })
@@ -757,13 +752,8 @@
[]))
(HsUnrestrictedArrow
(L
- (EpAnn
- (Anchor
- { KindSigs.hs:22:30-31 }
- (UnchangedAnchor))
- (NoEpAnns)
- (EpaComments
- []))
+ (TokenLoc
+ (EpaSpan { KindSigs.hs:22:30-31 }))
(HsNormalTok)))
(L
(SrcSpanAnn (EpAnnNotUsed) { KindSigs.hs:22:25-28 })
diff --git a/testsuite/tests/parser/should_compile/T14189.stderr b/testsuite/tests/parser/should_compile/T14189.stderr
index ecfcae56c8..c845817586 100644
--- a/testsuite/tests/parser/should_compile/T14189.stderr
+++ b/testsuite/tests/parser/should_compile/T14189.stderr
@@ -63,10 +63,10 @@
(HsLinearArrow
(HsPct1
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsTok))
(L
- (EpAnnNotUsed)
+ (NoTokenLoc)
(HsNormalTok))))
(L
(SrcSpanAnn (EpAnnNotUsed) { T14189.hs:6:18-20 })