[commit: ghc] wip/ghc-8.8-merges: Lexer: Alternate Layout Rule injects actual not virtual braces (e0375ba)
git at git.haskell.org
git at git.haskell.org
Thu Feb 21 15:10:52 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/ghc-8.8-merges
Link : http://ghc.haskell.org/trac/ghc/changeset/e0375ba980fd5639d23a29575efb00c30d97c743/ghc
>---------------------------------------------------------------
commit e0375ba980fd5639d23a29575efb00c30d97c743
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date: Sun Feb 3 10:27:42 2019 +0200
Lexer: Alternate Layout Rule injects actual not virtual braces
When the alternate layout rule is activated via a pragma, it injects
tokens for { and } to make sure that the source is parsed properly.
But it injects ITocurly and ITccurly, rather than their virtual
counterparts ITvocurly and ITvccurly.
This causes problems for ghc-exactprint, which tries to print these.
Likewise, any injected ITsemi should have a zero-width SrcSpan.
Test case (the existing T13087.hs)
{-# LANGUAGE AlternativeLayoutRule #-}
{-# LANGUAGE LambdaCase #-}
isOne :: Int -> Bool
isOne = \case 1 -> True
_ -> False
main = return ()
Closes #16279
(cherry picked from commit c1cf2693d6efddeeeb813cd8995a1be136800d17)
>---------------------------------------------------------------
e0375ba980fd5639d23a29575efb00c30d97c743
compiler/parser/Lexer.x | 32 ++++++++++++----------
libraries/Cabal | 2 +-
libraries/transformers | 2 +-
testsuite/tests/ghc-api/annotations/Makefile | 20 ++++++++++++++
testsuite/tests/ghc-api/annotations/T16279.stdout | 30 ++++++++++++++++++++
.../T13087.hs => ghc-api/annotations/Test16279.hs} | 2 ++
testsuite/tests/ghc-api/annotations/all.T | 2 ++
utils/haddock | 2 +-
utils/hsc2hs | 2 +-
9 files changed, 75 insertions(+), 19 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 e0375ba980fd5639d23a29575efb00c30d97c743
More information about the ghc-commits
mailing list