aboutsummaryrefslogtreecommitdiff
path: root/src/HsParser.ly
Commit message (Collapse)AuthorAgeFilesLines
* Initial modifications -- doesn't compiledavve2006-07-101-3/+3
|
* Teach haddock about line pragmas and add accurate source code linksDuncan Coutts2006-01-211-5/+5
| | | | | | | | | | | | | | | | | | | | | Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N
* [haddock @ 2004-08-09 11:55:05 by simonmar]simonmar2004-08-091-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger@informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header.
* [haddock @ 2004-04-20 13:08:04 by simonmar]simonmar2004-04-201-2/+2
| | | | | | Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add.
* [haddock @ 2003-10-20 17:19:22 by sof]sof2003-10-201-18/+53
| | | | support for i-parameters + zip comprehensions
* [haddock @ 2002-07-19 10:00:16 by simonmar]simonmar2002-07-191-14/+16
| | | | | | | | | | | | Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration.
* [haddock @ 2002-07-19 09:13:10 by simonmar]simonmar2002-07-191-16/+22
| | | | Allow special id's ([], (), etc.) to be used in an import declaration.
* [haddock @ 2002-07-15 16:16:50 by simonmar]simonmar2002-07-151-5/+7
| | | | | | | | Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs).
* [haddock @ 2002-07-15 10:14:30 by simonmar]simonmar2002-07-151-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int }
* [haddock @ 2002-06-20 12:38:07 by simonmar]simonmar2002-06-201-11/+7
| | | | Empty declaration fixes.
* [haddock @ 2002-06-03 13:05:57 by simonmar]simonmar2002-06-031-2/+3
| | | | | | | Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case).
* [haddock @ 2002-05-27 09:03:51 by simonmar]simonmar2002-05-271-2/+3
| | | | | | | | | | | | | | Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others)
* [haddock @ 2002-05-15 13:03:01 by simonmar]simonmar2002-05-151-53/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed.
* [haddock @ 2002-05-09 12:43:06 by simonmar]simonmar2002-05-091-2/+2
| | | | Type synonyms can accept a ctype on the RHS, to match GHC.
* [haddock @ 2002-05-08 14:48:39 by simonmar]simonmar2002-05-081-9/+21
| | | | Add support for existential quantifiers on constructors.
* [haddock @ 2002-05-08 11:21:56 by simonmar]simonmar2002-05-081-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak@cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace.
* [haddock @ 2002-05-06 12:32:32 by simonmar]simonmar2002-05-061-4/+8
| | | | Allow empty data declarations (another GHC extension).
* [haddock @ 2002-04-29 15:28:54 by simonmar]simonmar2002-04-291-10/+16
| | | | Allow '-- |' style annotations on constructors and record fields.
* [haddock @ 2002-04-26 11:18:56 by simonmar]simonmar2002-04-261-6/+21
| | | | | | | - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2
* [haddock @ 2002-04-25 14:40:05 by simonmar]simonmar2002-04-251-1/+5
| | | | | | | - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode.
* [haddock @ 2002-04-24 15:57:47 by simonmar]simonmar2002-04-241-8/+8
| | | | Handle gcons in export lists (a common extension).
* [haddock @ 2002-04-10 13:23:55 by simonmar]simonmar2002-04-101-2/+2
| | | | | Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow.
* [haddock @ 2002-04-04 16:23:43 by simonmar]simonmar2002-04-041-0/+886
This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations.