diff options
Diffstat (limited to 'src/HaddockLex.hs')
-rw-r--r-- | src/HaddockLex.hs | 14 |
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 |