From 0a09c293d3d2294363a86f41bc74c3f5df123a08 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 6 Nov 2003 12:39:47 +0000 Subject: [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo@. -- -- [@bar@] The description of @bar@. Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. --- src/HaddockParse.y | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/HaddockParse.y') diff --git a/src/HaddockParse.y b/src/HaddockParse.y index 29b3b70a..dbc97446 100644 --- a/src/HaddockParse.y +++ b/src/HaddockParse.y @@ -9,10 +9,12 @@ import HsSyn %token '/' { TokSpecial '/' } '@' { TokSpecial '@' } + '[' { TokDefStart } + ']' { TokDefEnd } DQUO { TokSpecial '\"' } URL { TokURL $$ } ANAME { TokAName $$ } - '*' { TokBullet } + '-' { TokBullet } '(n)' { TokNumber } '>..' { TokBirdTrack $$ } IDENT { TokIdent $$ } @@ -35,14 +37,18 @@ doc :: { Doc } apara :: { Doc } : ulpara { DocUnorderedList [$1] } | olpara { DocOrderedList [$1] } + | defpara { DocDefList [$1] } | para { $1 } ulpara :: { Doc } - : '*' para { $2 } + : '-' para { $2 } olpara :: { Doc } : '(n)' para { $2 } +defpara :: { (Doc,Doc) } + : '[' seq ']' seq { ($2, $4) } + para :: { Doc } : seq { docParagraph $1 } | codepara { DocCodeBlock $1 } -- cgit v1.2.3