aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
index 9d58728f..29edb4c3 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
@@ -90,6 +90,9 @@ tokenize =
}
classify :: String -> TokenType
+classify str
+ | "--" `isPrefixOf` str = TkComment
+ | "{-" `isPrefixOf` str = TkComment
classify (c:_)
| isSpace c = TkSpace
| isDigit c = TkNumber
@@ -101,8 +104,6 @@ classify str
| str `elem` keywords = TkKeyword
| str `elem` glyphs = TkGlyph
| all (`elem` symbols) str = TkOperator
- | "--" `isPrefixOf` str = TkComment
- | "{-" `isPrefixOf` str = TkComment
| isIdentifier str = TkIdentifier
| otherwise = TkUnknown