aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockParse.y
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-11-06 12:39:47 +0000
committersimonmar <unknown>2003-11-06 12:39:47 +0000
commit0a09c293d3d2294363a86f41bc74c3f5df123a08 (patch)
treef8e6cc8cc967de6d16d0be67390db1ed9504095d /src/HaddockParse.y
parenta2bca16d0c180768949a8f30592bb072c907b965 (diff)
[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.
Diffstat (limited to 'src/HaddockParse.y')
-rw-r--r--src/HaddockParse.y10
1 files changed, 8 insertions, 2 deletions
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 }