Changes between Version 25 and Version 26 of HaddockComments


Ignore:
Timestamp:
Mar 18, 2007 10:37:07 PM (8 years ago)
Author:
waern
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HaddockComments

    v25 v26  
    3131
    3232= Binding groups =
    33 Before the renaming phase, GHC restructures function definitions into binding groups. This is done by going through the list of {{{HsDecl}}}s representing the top declarations of the source file, grouping different type of declarations together.
    34 
    35 We do this with the top level doc comments as well. There's a problem though: An external program must be able to use the GHC API to associate multiple "next" and "prev" style comments with the right Haskell binding. This can be done by looking at the parsed syntax tree, where the file structure is preserved. But, by going through this restructuring, the renamed syntax loose this structure. We want to be able to use the renamed syntax, so instead of just grouping the comments together, we let the grouping process return a list of {{{DocEntity}}}:
    36 {{{
    37 -- source code entities, for representing the module structure
    38 data DocEntity name
    39   = DeclEntity name
    40   | DocEntity (DocDecl name)
    41 }}}
    42 
    43 An external program can now figure out which doc comment belongs to what "entity", i.e what Haskell binding. This solution is also used for method declarations in classes.
     33Before the renaming phase, GHC restructures function definitions, data declarations, classes and other declarations into binding groups. This is done by going through the list of {{{HsDecl}}}s representing the top declarations of the source file, grouping different type of declarations together. The top level Haddock declarations are grouped together here as well. GHC API clients can look at the SrcLoc of the Haddock declarations to determine which top level declaration it documents.
    4434
    4535= The renamer =