aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Lex.x
diff options
context:
space:
mode:
authorKazu Yamamoto <kazu@iij.ad.jp>2012-04-09 15:45:57 +0900
committerSimon Hengel <sol@typeful.net>2012-10-09 12:45:31 +0200
commit72675c1bf281b81041a19014b1b7df03a0de9488 (patch)
tree70b5fd4875eb604d1b092912d84a1fc696126b2a /src/Haddock/Lex.x
parentac8417bd0e947d81713a8ec31fe048aa43e34c03 (diff)
Add markup support for properties
Diffstat (limited to 'src/Haddock/Lex.x')
-rw-r--r--src/Haddock/Lex.x8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x
index b9ebe688..35e6dd8a 100644
--- a/src/Haddock/Lex.x
+++ b/src/Haddock/Lex.x
@@ -50,6 +50,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
<0,para> {
$ws* \n ;
$ws* \> { begin birdtrack }
+ $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr }
$ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr }
$ws* [\*\-] { token TokBullet `andBegin` string }
$ws* \[ { token TokDefStart `andBegin` def }
@@ -61,6 +62,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
-- beginning of a line
<line> {
$ws* \> { begin birdtrack }
+ $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr }
$ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr }
$ws* \n { token TokPara `andBegin` para }
-- Here, we really want to be able to say
@@ -84,6 +86,10 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
<exampleresult> .* \n { strtokenNL TokExampleResult `andBegin` example }
+<propertyexpr> .* \n { strtokenNL TokPropertyExpression `andBegin` property }
+
+<property> () { token TokPara `andBegin` para }
+
<string,def> {
$special { strtoken $ \s -> TokSpecial (head s) }
\<\< [^\>]* \>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) }
@@ -129,6 +135,8 @@ data Token
| TokEmphasis String
| TokAName String
| TokBirdTrack String
+ | TokPropertyPrompt String
+ | TokPropertyExpression String
| TokExamplePrompt String
| TokExampleExpression String
| TokExampleResult String