[commit: ghc] master: Add HsSyn prettyprinter tests (499e438)
git at git.haskell.org
git at git.haskell.org
Wed Dec 7 19:31:30 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/499e43824bda967546ebf95ee33ec1f84a114a7c/ghc
>---------------------------------------------------------------
commit 499e43824bda967546ebf95ee33ec1f84a114a7c
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date: Tue Nov 8 21:37:48 2016 +0200
Add HsSyn prettyprinter tests
Summary:
Add prettyprinter tests, which take a file, parse it, pretty print it,
re-parse the pretty printed version and then compare the original and
new ASTs (ignoring locations)
Updates haddock submodule to match the AST changes.
There are three issues outstanding
1. Extra parens around a context are not reproduced. This will require an
AST change and will be done in a separate patch.
2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
to prevent noise in the output.
I am not sure what the desired behaviour in this case is, so have left
it as before. Test Ppr047 is marked as expected fail for this.
3. Apart from in a context, the ParsedSource AST keeps all the parens from
the original source. Something is happening in the renamer to remove the
parens around visible type application, causing T12530 to fail, as the
dumped splice decl is after the renamer.
This needs to be fixed by keeping the parens, but I do not know where they
are being removed. I have amended the test to pass, by removing the parens
in the expected output.
Test Plan: ./validate
Reviewers: goldfire, mpickering, simonpj, bgamari, austin
Reviewed By: simonpj, bgamari
Subscribers: simonpj, goldfire, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2752
GHC Trac Issues: #3384
>---------------------------------------------------------------
499e43824bda967546ebf95ee33ec1f84a114a7c
compiler/basicTypes/BasicTypes.hs | 90 ++++-
compiler/basicTypes/DataCon.hs | 2 +-
compiler/basicTypes/MkId.hs | 3 +-
compiler/basicTypes/Var.hs | 3 +
compiler/coreSyn/PprCore.hs | 2 +-
compiler/deSugar/Coverage.hs | 5 +-
compiler/deSugar/DsArrows.hs | 2 +-
compiler/deSugar/DsCCall.hs | 3 +-
compiler/deSugar/DsForeign.hs | 2 +-
compiler/deSugar/DsMeta.hs | 23 +-
compiler/deSugar/MatchLit.hs | 6 +-
compiler/hsSyn/Convert.hs | 126 +++---
compiler/hsSyn/HsBinds.hs | 75 ++--
compiler/hsSyn/HsDecls.hs | 212 ++++++----
compiler/hsSyn/HsExpr.hs | 252 +++++++-----
compiler/hsSyn/HsExpr.hs-boot | 24 +-
compiler/hsSyn/HsImpExp.hs | 25 +-
compiler/hsSyn/HsLit.hs | 43 ++-
compiler/hsSyn/HsPat.hs | 25 +-
compiler/hsSyn/HsPat.hs-boot | 4 +-
compiler/hsSyn/HsSyn.hs | 3 +-
compiler/hsSyn/HsTypes.hs | 130 ++++---
compiler/hsSyn/HsUtils.hs | 43 ++-
compiler/hsSyn/PlaceHolder.hs | 7 +
compiler/iface/BuildTyCl.hs | 2 +-
compiler/iface/LoadIface.hs | 3 +-
compiler/iface/TcIface.hs | 2 +-
compiler/main/HeaderInfo.hs | 2 +-
compiler/parser/Lexer.x | 103 ++---
compiler/parser/Parser.y | 56 +--
compiler/parser/RdrHsSyn.hs | 30 +-
compiler/prelude/ForeignCall.hs | 12 +-
compiler/prelude/PrimOp.hs | 3 +-
compiler/prelude/TysWiredIn.hs | 30 +-
compiler/rename/RnEnv.hs | 9 +-
compiler/rename/RnExpr.hs | 8 +-
compiler/rename/RnPat.hs | 2 +-
compiler/rename/RnSplice.hs | 16 +-
compiler/rename/RnTypes.hs | 26 +-
compiler/stranal/WorkWrap.hs | 6 +-
compiler/typecheck/Inst.hs | 7 +-
compiler/typecheck/TcAnnotations.hs | 2 +-
compiler/typecheck/TcArrows.hs | 4 +-
compiler/typecheck/TcBinds.hs | 2 +-
compiler/typecheck/TcEnv.hs | 5 +-
compiler/typecheck/TcGenDeriv.hs | 22 +-
compiler/typecheck/TcGenFunctor.hs | 5 +-
compiler/typecheck/TcGenGenerics.hs | 12 +-
compiler/typecheck/TcHsSyn.hs | 4 +-
compiler/typecheck/TcHsType.hs | 4 +-
compiler/typecheck/TcInstDcls.hs | 2 +-
compiler/typecheck/TcPat.hs | 3 +-
compiler/typecheck/TcPatSyn.hs | 9 +-
compiler/typecheck/TcSplice.hs | 2 +-
compiler/typecheck/TcTyClsDecls.hs | 2 +-
compiler/typecheck/TcTyDecls.hs | 2 +-
compiler/typecheck/TcTypeable.hs | 6 +-
compiler/utils/Binary.hs | 15 +
compiler/utils/BooleanFormula.hs | 16 +-
compiler/utils/Outputable.hs | 4 +-
compiler/vectorise/Vectorise/Generic/PData.hs | 5 +-
ghc.mk | 3 +
testsuite/mk/boilerplate.mk | 1 +
testsuite/tests/ado/ado002.stderr | 66 ++--
testsuite/tests/ado/ado003.stderr | 6 +-
testsuite/tests/ado/ado005.stderr | 12 +-
.../tests/arrows/should_fail/arrowfail004.stderr | 4 +-
testsuite/tests/boxy/Base1.stderr | 4 +-
.../dependent/should_fail/PromotedClass.stderr | 5 +-
.../tests/dependent/should_fail/RAE_T32a.stderr | 2 +-
.../tests/dependent/should_fail/T11334b.stderr | 18 +-
testsuite/tests/ffi/should_fail/T10461.stderr | 2 +-
testsuite/tests/ffi/should_fail/T3066.stderr | 3 +-
testsuite/tests/ffi/should_fail/T7506.stderr | 2 +-
.../ffi/should_fail/capi_value_function.stderr | 3 +-
testsuite/tests/ffi/should_fail/ccfail001.stderr | 3 +-
testsuite/tests/ffi/should_fail/ccfail002.stderr | 2 +-
testsuite/tests/ffi/should_fail/ccfail004.stderr | 10 +-
testsuite/tests/ffi/should_fail/ccfail005.stderr | 6 +-
testsuite/tests/generics/GenDerivOutput.stderr | 56 +--
testsuite/tests/generics/GenDerivOutput1_0.stderr | 14 +-
testsuite/tests/generics/GenDerivOutput1_1.stderr | 115 +++---
.../tests/generics/T10604/T10604_deriving.stderr | 68 ++--
.../ghc-api/annotations-literals/literals.stdout | 16 +-
.../tests/ghc-api/annotations-literals/parsed.hs | 38 +-
.../ghc-api/annotations-literals/parsed.stdout | 8 +-
testsuite/tests/ghc-api/annotations/T10276.stderr | 24 +-
testsuite/tests/ghc-api/annotations/T10313.stdout | 32 +-
testsuite/tests/ghc-api/annotations/T11430.stdout | 2 +-
testsuite/tests/ghc-api/annotations/t11430.hs | 14 +-
testsuite/tests/ghci/scripts/T8959b.stderr | 4 +-
.../haddock/haddock_examples/haddock.Test.stderr | 4 +-
.../should_compile_flag_haddock/T11768.stderr | 2 +-
.../should_compile_flag_haddock/haddockA028.stderr | 2 +-
.../indexed-types/should_fail/SimpleFail14.stderr | 2 +-
.../tests/indexed-types/should_fail/T12867.stderr | 4 +-
.../tests/indexed-types/should_fail/T2664.stderr | 16 +-
.../tests/indexed-types/should_fail/T2693.stderr | 6 +-
.../tests/indexed-types/should_fail/T5439.stderr | 4 +-
.../tests/indexed-types/should_fail/T7786.stderr | 12 +-
testsuite/tests/monadfail/MonadFailErrors.stderr | 32 +-
testsuite/tests/monadfail/MonadFailWarnings.stderr | 32 +-
.../partial-sigs/should_compile/SplicesUsed.stderr | 8 +-
.../partial-sigs/should_compile/T12845.stderr | 2 +-
testsuite/tests/polykinds/PolyKinds04.stderr | 2 +-
testsuite/tests/polykinds/PolyKinds07.stderr | 4 +-
testsuite/tests/polykinds/T10503.stderr | 3 +-
testsuite/tests/polykinds/T11399.stderr | 2 +-
testsuite/tests/polykinds/T11520.stderr | 2 +-
testsuite/tests/polykinds/T11611.stderr | 2 +-
testsuite/tests/polykinds/T5716.stderr | 2 +-
testsuite/tests/polykinds/T5716a.stderr | 2 +-
testsuite/tests/polykinds/T6054.stderr | 6 +-
testsuite/tests/polykinds/T7151.stderr | 2 +-
testsuite/tests/polykinds/T7328.stderr | 2 +-
testsuite/tests/polykinds/T7433.stderr | 2 +-
testsuite/tests/polykinds/T7805.stderr | 2 +-
testsuite/tests/printer/.gitignore | 17 +
testsuite/tests/printer/Makefile | 195 ++++++++++
testsuite/tests/printer/Ppr001.hs | 7 +
testsuite/tests/printer/Ppr002.hs | 46 +++
testsuite/tests/printer/Ppr003.hs | 11 +
testsuite/tests/printer/Ppr004.hs | 81 ++++
testsuite/tests/printer/Ppr005.hs | 11 +
testsuite/tests/printer/Ppr006.hs | 257 +++++++++++++
testsuite/tests/printer/Ppr006.stderr | 45 +++
testsuite/tests/printer/Ppr007.hs | 8 +
testsuite/tests/printer/Ppr007.stderr | 17 +
testsuite/tests/printer/Ppr008.hs | 213 ++++++++++
testsuite/tests/printer/Ppr009.hs | 9 +
testsuite/tests/printer/Ppr009.stderr | 28 ++
testsuite/tests/printer/Ppr010.hs | 17 +
testsuite/tests/printer/Ppr011.hs | 34 ++
testsuite/tests/printer/Ppr011.stderr | 12 +
testsuite/tests/printer/Ppr012.hs | 42 ++
testsuite/tests/printer/Ppr012.stderr | 8 +
testsuite/tests/printer/Ppr012.stdout | 186 +++++++++
testsuite/tests/printer/Ppr013.hs | 13 +
testsuite/tests/printer/Ppr013.stderr | 6 +
testsuite/tests/printer/Ppr014.hs | 59 +++
testsuite/tests/printer/Ppr014.stderr | 76 ++++
testsuite/tests/printer/Ppr015.hs | 5 +
testsuite/tests/printer/Ppr016.hs | 4 +
testsuite/tests/printer/Ppr016.stderr | 14 +
testsuite/tests/printer/Ppr017.hs | 9 +
testsuite/tests/printer/Ppr018.hs | 20 +
testsuite/tests/printer/Ppr018.stderr | 12 +
testsuite/tests/printer/Ppr019.hs | 427 +++++++++++++++++++++
testsuite/tests/printer/Ppr020.hs | 11 +
testsuite/tests/printer/Ppr020.stderr | 31 ++
testsuite/tests/printer/Ppr021.hs | 63 +++
testsuite/tests/printer/Ppr021.stderr | 16 +
testsuite/tests/printer/Ppr022.hs | 12 +
testsuite/tests/printer/Ppr022.stderr | 28 ++
testsuite/tests/printer/Ppr023.hs | 37 ++
testsuite/tests/printer/Ppr023.stderr | 49 +++
testsuite/tests/printer/Ppr024.hs | 47 +++
testsuite/tests/printer/Ppr024.stderr | 6 +
testsuite/tests/printer/Ppr025.hs | 30 ++
testsuite/tests/printer/Ppr025.stderr | 6 +
testsuite/tests/printer/Ppr026.hs | 14 +
testsuite/tests/printer/Ppr026.stderr | 6 +
testsuite/tests/printer/Ppr027.hs | 5 +
testsuite/tests/printer/Ppr028.hs | 12 +
testsuite/tests/printer/Ppr028.stderr | 6 +
testsuite/tests/printer/Ppr029.hs | 37 ++
testsuite/tests/printer/Ppr029.stderr | 16 +
testsuite/tests/printer/Ppr030.hs | 10 +
testsuite/tests/printer/Ppr030.stderr | 6 +
testsuite/tests/printer/Ppr031.hs | 22 ++
testsuite/tests/printer/Ppr031.stderr | 46 +++
testsuite/tests/printer/Ppr032.hs | 40 ++
testsuite/tests/printer/Ppr032.stderr | 18 +
testsuite/tests/printer/Ppr033.hs | 21 +
testsuite/tests/printer/Ppr033.stderr | 8 +
testsuite/tests/printer/Ppr034.hs | 423 ++++++++++++++++++++
testsuite/tests/printer/Ppr034.stderr | 42 ++
testsuite/tests/printer/Ppr035.hs | 14 +
testsuite/tests/printer/Ppr036.hs | 15 +
testsuite/tests/printer/Ppr036.stderr | 6 +
testsuite/tests/printer/Ppr037.hs | 64 +++
testsuite/tests/printer/Ppr037.stderr | 48 +++
testsuite/tests/printer/Ppr038.hs | 26 ++
testsuite/tests/printer/Ppr039.hs | 30 ++
testsuite/tests/printer/Ppr039.stderr | 73 ++++
testsuite/tests/printer/Ppr040.hs | 43 +++
testsuite/tests/printer/Ppr040.stderr | 38 ++
.../should_run/T10104.hs => printer/Ppr041.hs} | 0
testsuite/tests/printer/Ppr042.hs | 8 +
testsuite/tests/printer/Ppr042.stderr | 28 ++
.../tests/{th/T10620.hs => printer/Ppr043.hs} | 0
.../T1830_2.hs => printer/Ppr044.hs} | 0
testsuite/tests/printer/Ppr045.hs | 78 ++++
testsuite/tests/printer/Ppr046.hs | 36 ++
testsuite/tests/printer/Ppr046.stderr | 61 +++
testsuite/tests/printer/Ppr047.hs | 4 +
testsuite/tests/printer/all.T | 47 +++
testsuite/tests/quasiquotation/T7918.hs | 2 +-
testsuite/tests/rebindable/rebindable6.stderr | 36 +-
.../tests/rename/should_fail/Misplaced.stderr | 2 +-
.../tests/rename/should_fail/rnfail026.stderr | 2 +-
testsuite/tests/roles/should_compile/T8958.stderr | 4 +-
testsuite/tests/safeHaskell/ghci/p6.stderr | 2 +-
.../safeHaskell/safeLanguage/SafeLang08.stderr | 2 +-
.../safeHaskell/safeLanguage/SafeLang10.stderr | 6 +-
.../safeHaskell/safeLanguage/SafeLang17.stderr | 6 +-
.../tests/simplCore/should_compile/T7785.stderr | 2 +-
.../tests/simplCore/should_compile/T8331.stderr | 2 +-
.../tests/simplCore/should_compile/T8848a.stderr | 2 +-
.../tests/simplCore/should_compile/simpl017.stderr | 18 +-
testsuite/tests/th/T10598_TH.stderr | 74 ++--
testsuite/tests/th/T10638.stderr | 3 +-
testsuite/tests/th/T12530.stderr | 2 +-
testsuite/tests/th/T3177a.stderr | 6 +-
testsuite/tests/th/T3319.stderr | 2 +-
testsuite/tests/th/T3899a.hs | 3 +-
testsuite/tests/th/T4436.stderr | 13 +-
testsuite/tests/th/T5217.stderr | 6 +-
testsuite/tests/th/T5358.stderr | 8 +-
testsuite/tests/th/T5508.stderr | 8 +-
testsuite/tests/th/T5700.stderr | 2 +-
testsuite/tests/th/T5883.stderr | 2 +-
testsuite/tests/th/T7532.stderr | 4 +-
testsuite/tests/th/T8577.stderr | 4 +-
testsuite/tests/th/T8761.stderr | 112 +++---
testsuite/tests/th/TH_PromotedTuple.stderr | 6 +-
testsuite/tests/th/TH_exn2.stderr | 4 +-
.../tests/th/TH_foreignCallingConventions.stderr | 33 +-
testsuite/tests/th/TH_foreignInterruptible.stderr | 3 +-
testsuite/tests/th/TH_pragma.stderr | 4 +-
testsuite/tests/th/TH_unresolvedInfix2.stderr | 2 +-
.../tests/typecheck/should_compile/T11339.stderr | 4 +-
.../tests/typecheck/should_compile/tc211.stderr | 12 +-
.../tests/typecheck/should_fail/T11464.stderr | 2 +-
.../tests/typecheck/should_fail/T12124.stderr | 4 +-
testsuite/tests/typecheck/should_fail/T2994.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T3540.stderr | 15 +-
testsuite/tests/typecheck/should_fail/T3613.stderr | 8 +-
.../tests/typecheck/should_fail/T7748a.stderr | 4 +-
testsuite/tests/typecheck/should_fail/T7851.stderr | 8 +-
testsuite/tests/typecheck/should_fail/T8603.stderr | 4 +-
testsuite/tests/typecheck/should_fail/T9201.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T9612.stderr | 8 +-
.../tests/typecheck/should_fail/tcfail028.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail070.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail103.stderr | 8 +-
.../tests/typecheck/should_fail/tcfail128.stderr | 18 +-
.../tests/typecheck/should_fail/tcfail132.stderr | 4 +-
.../tests/typecheck/should_fail/tcfail146.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail162.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail165.stderr | 6 +-
.../tests/typecheck/should_fail/tcfail168.stderr | 18 +-
testsuite/tests/unboxedsums/ffi1.stderr | 7 +-
.../wcompat-warnings/WCompatWarningsOn.stderr | 8 +-
utils/check-ppr/Main.hs | 219 +++++++++++
utils/check-ppr/README | 20 +
utils/check-ppr/check-ppr.cabal | 32 ++
utils/check-ppr/ghc.mk | 18 +
utils/genprimopcode/Parser.y | 6 +-
utils/genprimopcode/Syntax.hs | 8 +-
utils/haddock | 2 +-
261 files changed, 5453 insertions(+), 1220 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 499e43824bda967546ebf95ee33ec1f84a114a7c
More information about the ghc-commits
mailing list