Work SourceText in for all integer literals
authorAlan Zimmerman <alan.zimm@gmail.com>
Thu, 14 Jan 2016 22:03:58 +0000 (00:03 +0200)
committerAlan Zimmerman <alan.zimm@gmail.com>
Sat, 16 Jan 2016 13:54:04 +0000 (15:54 +0200)
commit3a1babd6243edd96073ed3e3a5fb6e0aaf11350e
treee578589e61895b392c761daaa2cb14f790fac5d8
parent148a50b5f8a9db4c3e2724540c41a7a7a10b3194
Work SourceText in for all integer literals

Summary:
Certain syntactic elements have integers in them, such as fixity
specifications, SPECIALISE pragmas and so on.

The lexer will accept mult-radix literals, with arbitrary leading zeros
in these.

Bring in a SourceText field to each affected AST element to capture the
original literal text for use with API Annotations.

Affected hsSyn elements are

```
     -- See note [Pragma source text]
     data Activation = NeverActive
                     | AlwaysActive
                     | ActiveBefore SourceText PhaseNum
                          -- Active only *strictly before* this phase
                     | ActiveAfter SourceText PhaseNum
                           -- Active in this phase and later
                     deriving( Eq, Data, Typeable )
                               -- Eq used in comparing rules in HsDecls

     data Fixity = Fixity SourceText Int FixityDirection
       -- Note [Pragma source text]
       deriving (Data, Typeable)
 ```

and

```
      | HsTickPragma         -- A pragma introduced tick
         SourceText           -- Note [Pragma source text] in BasicTypes
         (StringLiteral,(Int,Int),(Int,Int))
                                          -- external span for this tick
         ((SourceText,SourceText),(SourceText,SourceText))
            -- Source text for the four integers used in the span.
            -- See note [Pragma source text] in BasicTypes
         (LHsExpr id)
```

Updates haddock submodule

Test Plan: ./validate

Reviewers: goldfire, bgamari, austin

Reviewed By: bgamari

Subscribers: thomie, mpickering

Differential Revision: https://phabricator.haskell.org/D1781

GHC Trac Issues: #11430
33 files changed:
compiler/basicTypes/BasicTypes.hs
compiler/basicTypes/MkId.hs
compiler/deSugar/Coverage.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsMeta.hs
compiler/deSugar/PmExpr.hs
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsExpr.hs
compiler/iface/LoadIface.hs
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/rename/RnEnv.hs
compiler/rename/RnExpr.hs
compiler/rename/RnTypes.hs
compiler/simplCore/SimplUtils.hs
compiler/stranal/WorkWrap.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcGenGenerics.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSplice.hs
compiler/utils/Binary.hs
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T11430.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test11430.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/ghc-api/annotations/stringSource.hs
testsuite/tests/ghc-api/annotations/t11430.hs [new file with mode: 0644]
utils/genprimopcode/Main.hs
utils/genprimopcode/Parser.y
utils/genprimopcode/Syntax.hs
utils/haddock