[GHC] #8226: Remove the old style -- # Haddock comments.

GHC ghc-devs at haskell.org
Tue Jun 17 21:28:10 UTC 2014


#8226: Remove the old style -- # Haddock comments.
-------------------------------------+------------------------------------
        Reporter:  Fuuzetsu          |            Owner:  adinapoli
            Type:  task              |           Status:  patch
        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 Fuuzetsu):

 Hm, I'm unsure why this is proving difficult to implement. Looking at the
 lexer, it seems that it should be enough to:

 * Remove {{{#}}} from any sections lexing Haddock comment so sections like
 {{{[$docSym \#]}}} become just {{{[$docSym]}}} or whatever the appropriate
 syntax is there.

 * in {{{<options_prags>}}} remove the lexing of {{{-- #}}} all together.

 * Remove {{{ITdocOptionsOld}}}.

 * inside {{{isNormalComment}}}, I'm unsure exactly how to proceed. You say
 removing {{{#}}} from {{{notFollowedByDocOrPragma}}} stops {{{RULES}}}
 from working.  In that case I say keep it there as it is now, in the end
 it does not matter because we'll stop treating it as a Haddock thing
 anyway. It will now simply check whether a {{{#}}} comment is special for
 {{{RULES}}} instead of for both {{{RULES}}} and Haddock. This is an
 assumption however so this might be where I'm going wrong.

 * {{{withLexedDocType}}} remove the case for {{{'#'}}}: if we removed the
 case for {{{-- #}}} in {{{<options_prags>}}} then we should never enter
 {{{withLexedDocType}}} through {{{multiline_doc_comment}}} at least as far
 as I can see.

 * Remove the case in for {{{ITdocOptionsOld}}} in {{{getOptions'}}} in
 {{{HeaderInfo.hs}}}.

 I think this should be enough to allow us to not treat either {{{{- #}}}
 nor {{{-- #}}} as a Haddock thing while preserving the behaviour of
 everything else as it is now. Am I missing something?

 PS: It'd be great if you could create a wiki page (either on GHC wiki or
 NixOS wiki) on your workflow on GHC hacking with nix.

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


More information about the ghc-tickets mailing list