check-api-annotations checks for annotation preceding its span
authorAlan Zimmerman <alan.zimm@gmail.com>
Tue, 22 Jan 2019 21:29:25 +0000 (23:29 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sun, 27 Jan 2019 13:32:12 +0000 (08:32 -0500)
commit3cf12e6081e7a9f0c3d515de52ffd079186816a5
treeadbdf5e5fe78a2da3954259a1cce19d7911cb001
parent5cb071af5b02b7433b2bb4d06062ac8b6fb387e8
check-api-annotations checks for annotation preceding its span

For an API annotation to be useful, it must not occur before the span
it is enclosed in.

So, for check-api-annotation output, a line such as

((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]),

should be flagged as an error, as the AnnOpenP location of 3:21
precedes its enclosing span of 3:22-26.

This patch does this.

Closes #16217
30 files changed:
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T10255.stdout
testsuite/tests/ghc-api/annotations/T10268.stdout
testsuite/tests/ghc-api/annotations/T10269.stdout
testsuite/tests/ghc-api/annotations/T10276.stdout
testsuite/tests/ghc-api/annotations/T10278.stdout
testsuite/tests/ghc-api/annotations/T10280.stdout
testsuite/tests/ghc-api/annotations/T10307.stdout
testsuite/tests/ghc-api/annotations/T10309.stdout
testsuite/tests/ghc-api/annotations/T10312.stdout
testsuite/tests/ghc-api/annotations/T10354.stdout
testsuite/tests/ghc-api/annotations/T10357.stdout
testsuite/tests/ghc-api/annotations/T10358.stdout
testsuite/tests/ghc-api/annotations/T10396.stdout
testsuite/tests/ghc-api/annotations/T10399.stdout
testsuite/tests/ghc-api/annotations/T10598.stdout
testsuite/tests/ghc-api/annotations/T11018.stdout
testsuite/tests/ghc-api/annotations/T11321.stdout
testsuite/tests/ghc-api/annotations/T11332.stdout
testsuite/tests/ghc-api/annotations/T12417.stdout
testsuite/tests/ghc-api/annotations/T13163.stdout
testsuite/tests/ghc-api/annotations/T15303.stdout
testsuite/tests/ghc-api/annotations/T16212.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test16212.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/ghc-api/annotations/boolFormula.stdout
testsuite/tests/ghc-api/annotations/bundle-export.stdout
testsuite/tests/ghc-api/annotations/exampleTest.stdout
testsuite/tests/ghc-api/annotations/load-main.stdout
utils/check-api-annotations/Main.hs