Add HsEmbellished type to hsSyn wip/embelleshed-rdr
authorAlan Zimmerman <alan.zimm@gmail.com>
Fri, 17 Feb 2017 10:13:14 +0000 (12:13 +0200)
committerAlan Zimmerman <alan.zimm@gmail.com>
Sat, 18 Feb 2017 18:40:09 +0000 (20:40 +0200)
commit43a082bb59310d10d3c7550d5cbeaab384ca4c76
tree4aa60f80be7e87ede1db0af69e2c3e20d14d16a9
parent98e494afed3c73f88ff1d57a9ca46b1f6ddbd1b9
Add HsEmbellished type to hsSyn

Summary:
A RdrName can be parsed with parens or backquotes if it is used prefix or infix
respectively when it is normally not used that way.

This is not captured in hsSyn, and must be inferred from the occName when pretty
printing, or using the API annotations.

Introduce a wrapper type around the name to capture this

    data Embellished name
      = EName       name
      | EParens     (Located name)
      | EBackquotes (Located name)

So that we now have

    data HsExpr id
      = HsVar     (LEmbellished id)   -- ^ Variable

and in the other relevant points in hsSyn.

Test Plan: ./validate

Reviewers: bgamari, austin, goldfire

Subscribers: goldfire, thomie, mpickering, snowleopard

Differential Revision: https://phabricator.haskell.org/D3145
65 files changed:
compiler/deSugar/Check.hs
compiler/deSugar/Coverage.hs
compiler/deSugar/Desugar.hs
compiler/deSugar/DsArrows.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsGRHSs.hs
compiler/deSugar/DsMeta.hs
compiler/deSugar/DsUtils.hs
compiler/deSugar/Match.hs
compiler/deSugar/PmExpr.hs
compiler/ghc.cabal.in
compiler/ghc.mk
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsBinds.hs
compiler/hsSyn/HsDecls.hs
compiler/hsSyn/HsEmbellished.hs [new file with mode: 0644]
compiler/hsSyn/HsExpr.hs
compiler/hsSyn/HsPat.hs
compiler/hsSyn/HsSyn.hs
compiler/hsSyn/HsTypes.hs
compiler/hsSyn/HsUtils.hs
compiler/main/HscMain.hs
compiler/main/InteractiveEval.hs
compiler/parser/ApiAnnotation.hs
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/rename/RnBinds.hs
compiler/rename/RnEnv.hs
compiler/rename/RnExpr.hs
compiler/rename/RnNames.hs
compiler/rename/RnPat.hs
compiler/rename/RnSource.hs
compiler/rename/RnSplice.hs
compiler/rename/RnTypes.hs
compiler/typecheck/Inst.hs
compiler/typecheck/TcAnnotations.hs
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcEnv.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcHsType.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcPat.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSigs.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcTyDecls.hs
ghc/GHCi/UI/Info.hs
testsuite/tests/ghc-api/annotations/T10357.stdout
testsuite/tests/ghc-api/annotations/T11321.stdout
testsuite/tests/ghc-api/annotations/T13163.stdout
testsuite/tests/ghc-api/landmines/landmines.stdout
testsuite/tests/parser/should_compile/DumpParsedAst.hs
testsuite/tests/parser/should_compile/DumpParsedAst.stderr
testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
testsuite/tests/quasiquotation/T7918.hs
utils/ghctags/Main.hs
utils/haddock