[GHC] #8226: Remove the old style -- # Haddock comments.
GHC
ghc-devs at haskell.org
Sun May 25 19:41:36 UTC 2014
#8226: Remove the old style -- # Haddock comments.
-------------------------------------+------------------------------------
Reporter: Fuuzetsu | Owner:
Type: task | Status: new
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.7
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by adinapoli):
(Rewriting comment that the tracker wiped :'( )
In a nutshell this is my first session of GHC hacking ever, so please be
patient if - as I'm certain - my patch doesn't fully fix the issue or is
going in the wrong direction.
I have manually tested the fix modifying slightly the testcase attached to
the relevant haddock ticket:
http://trac.haskell.org/haddock/ticket/171
{{{
{- # LANGUAGE RecordWildCards #-}
module Fail where
data Foo = Foo {
a :: String
, b :: Int
}
showFoo Foo{..} = a
main :: IO ()
main = print $ showFoo (Foo "a" 10)
}}}
As pointed out that one is _not_ a pragma (mind the space), so it needs to
be interpreted as a normal comment, but Haddock chokes on it:
{{{
-- pre-fix
[nix-shell:ghc]$ ghc -haddock Fail.hs
[1 of 1] Compiling Main ( Fail.hs, Fail.o )
Fail.hs:1:4: parse error on input ‘#’
}}}
But after my patch it seems to accept it:
{{{
[nix-shell:ghc]$ ghc-dev -haddock Fail.hs
[1 of 1] Compiling Fail ( Fail.hs, Fail.o )
Fail.hs:10:9:
Illegal `..' in record pattern
Use RecordWildCards to permit this
}}}
I have ran "validate" before and after the patch and it seems no
regression was introduces, but being the Lexer such a delicate part I
really want to be cautious with it :)
Thanks guys,
hope I'm on the right track :)
Alfredo
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8226#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list