[GHC] #16279: Lexer: Alternate Layout Rule injects actual not virtual braces

GHC ghc-devs at haskell.org
Sat Feb 2 15:52:13 UTC 2019


#16279: Lexer: Alternate Layout Rule injects actual not virtual braces
-------------------------------------+-------------------------------------
           Reporter:  alanz          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.6.3
  (Parser)                           |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Incorrect API
  Unknown/Multiple                   |  annotation
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:  #13807
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 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.

 Test case (the existing T13087.hs)

 {{{#!hs
 {-# LANGUAGE AlternativeLayoutRule #-}
 {-# LANGUAGE LambdaCase            #-}

 isOne :: Int -> Bool
 isOne = \case 1 -> True
               _ -> False

 main = return ()
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16279>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list