diff options
Diffstat (limited to 'src/Haddock/Lex.x')
-rw-r--r-- | src/Haddock/Lex.x | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index 04b9f0c3..40ffbe92 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -45,6 +45,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~] <0,para> { $ws* \n ; $ws* \> { begin birdtrack } + $ws* ghci \> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* [\*\-] { token TokBullet `andBegin` string } $ws* \[ { token TokDefStart `andBegin` def } $ws* \( $digit+ \) { token TokNumber `andBegin` string } @@ -66,6 +67,16 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~] <birdtrack> .* \n? { strtokenNL TokBirdTrack `andBegin` line } +<example> { + $ws* \n { token TokPara `andBegin` para } + $ws* ghci \> { strtoken TokExamplePrompt `andBegin` exampleexpr } + () { begin exampleresult } +} + +<exampleexpr> .* \n { strtokenNL TokExampleExpression `andBegin` example } + +<exampleresult> .* \n { strtokenNL TokExampleResult `andBegin` example } + <string,def> { $special { strtoken $ \s -> TokSpecial (head s) } \<\<.*\>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) } @@ -108,6 +119,9 @@ data Token | TokEmphasis String | TokAName String | TokBirdTrack String + | TokExamplePrompt String + | TokExampleExpression String + | TokExampleResult String -- deriving Show -- ----------------------------------------------------------------------------- |