aboutsummaryrefslogtreecommitdiff
path: root/src/HsParser.ly
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-05-08 11:21:56 +0000
committersimonmar <unknown>2002-05-08 11:21:56 +0000
commit1283a3c195ed226fc6d1c84a25de1d42d556cfad (patch)
tree75a32fa4aacf1f3eda3ab912dd71ea58961178e4 /src/HsParser.ly
parentadc8107866e9371b7b20e4e3985f9eca2e8ba52c (diff)
[haddock @ 2002-05-08 11:21:56 by simonmar]
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.
Diffstat (limited to 'src/HsParser.ly')
-rw-r--r--src/HsParser.ly20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/HsParser.ly b/src/HsParser.ly
index 5a254ec1..2ca9c88f 100644
--- a/src/HsParser.ly
+++ b/src/HsParser.ly
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
-$Id: HsParser.ly,v 1.7 2002/05/06 12:32:32 simonmar Exp $
+$Id: HsParser.ly,v 1.8 2002/05/08 11:21:56 simonmar Exp $
(c) Simon Marlow, Sven Panne 1997-2000
@@ -72,6 +72,7 @@ Docs
> DOCPREV { DocCommentPrev $$ }
> DOCNAMED { DocCommentNamed $$ }
> DOCGROUP { DocSection _ _ }
+> DOCOPTIONS { DocOptions $$ }
Symbols
@@ -152,13 +153,18 @@ Module Header
> module :: { HsModule }
> : optdoc 'module' modid maybeexports 'where' body
-> { HsModule $3 $4 (reverse (fst $6)) (reverse (snd $6)) $1 }
+> { HsModule $3 $4 (reverse (fst $6)) (reverse (snd $6))
+> (fst $1) (snd $1) }
> | body
-> { HsModule main_mod Nothing (reverse (fst $1)) (reverse (snd $1)) Nothing }
-
-> optdoc :: { Maybe String }
-> : DOCNEXT { Just $1 }
-> | {- empty -} { Nothing }
+> { HsModule main_mod Nothing (reverse (fst $1)) (reverse (snd $1))
+> Nothing Nothing }
+
+> optdoc :: { (Maybe String, Maybe String) }
+> : DOCNEXT { (Nothing, Just $1) }
+> | DOCOPTIONS { (Just $1, Nothing) }
+> | DOCOPTIONS DOCNEXT { (Just $1, Just $2) }
+> | DOCNEXT DOCOPTIONS { (Just $2, Just $1) }
+> | {- empty -} { (Nothing, Nothing) }
> body :: { ([HsImportDecl],[HsDecl]) }
> : '{' bodyaux '}' { $2 }