aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockLex.hs
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-05-29 09:09:49 +0000
committersimonmar <unknown>2002-05-29 09:09:49 +0000
commit093f7e538e89d8f9a1f8362ba76a233b7c286a4f (patch)
treeaaad2f56e181ee3d873702c37d26709bc690f1ed /src/HaddockLex.hs
parent7e474ebfea020e4ed59324fbd9f8baf4b6fab705 (diff)
[haddock @ 2002-05-29 09:09:49 by simonmar]
Back out previous change until we can find a better way to do this.
Diffstat (limited to 'src/HaddockLex.hs')
-rw-r--r--src/HaddockLex.hs14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/HaddockLex.hs b/src/HaddockLex.hs
index f1646453..f766222d 100644
--- a/src/HaddockLex.hs
+++ b/src/HaddockLex.hs
@@ -11,7 +11,7 @@ module HaddockLex (
import Char
-special = '`' : '\'' : '\"' : '@' : []
+special = '`' : '\'' : '\"' : '@' : '/' : []
data Token
= TokPara
@@ -19,7 +19,6 @@ data Token
| TokBullet
| TokSpecial Char
| TokString String
- | TokEmph String
| TokURL String
| TokBirdTrack
deriving Show
@@ -34,7 +33,6 @@ tokenise "" = []
tokenise str = case str of
'<':cs -> tokenise_url cs
'\n':cs -> tokenise_newline tokenise cs
- '/':cs -> tokenise_emph tokenise cs
c:cs | c `elem` special -> TokSpecial c : tokenise cs
_other -> tokenise_string "" str
@@ -44,12 +42,6 @@ tokenise_newline next cs =
'>':cs -> TokBirdTrack : next cs -- bird track
_other -> tokenise_string "" cs
-tokenise_emph next cs =
- case break newlineSlash cs of
- (bef, aft@('\n':cs)) -> TokString ('/':bef) : next aft -- paragraph break
- (bef, '/':cs) -> TokEmph bef : next cs
- _other -> tokenise_string "" cs
-
tokenise_para cs =
case dropWhile nonNewlineSpace cs of
-- bullet: '*'
@@ -68,8 +60,6 @@ tokenise_para cs =
nonNewlineSpace c = isSpace c && c /= '\n'
-newlineSlash c = c == '\n' || c == '/'
-
-- ----------------------------------------------------------------------------
-- Within a paragraph, we don't throw away any whitespace (except before a
-- birdtrack, and before a paragraph break).
@@ -79,7 +69,6 @@ tokenise1 "" = []
tokenise1 str = case str of
'<':cs -> tokenise_url cs
'\n':cs -> tokenise_newline1 cs
- '/':cs -> tokenise_emph tokenise1 cs
c:cs | c `elem` special -> TokSpecial c : tokenise1 cs
_other -> tokenise_string "" str
@@ -104,7 +93,6 @@ tokenise_string str cs =
'\\':c:cs -> tokenise_string (c:str) cs
'\n':cs -> tokenise_string_newline str cs
'<':cs -> TokString (reverse str) : tokenise_url cs
- '/':cs -> TokString (reverse str) : tokenise_emph (tokenise_string "") cs
c:cs | c `elem` special -> TokString (reverse str) : tokenise1 (c:cs)
| otherwise -> tokenise_string (c:str) cs