aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-02 13:41:38 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-02 13:41:38 +0200
commitaa6c6deba47af1c21765ed09dc0317825aa1d78d (patch)
treed9e8feadfe3231b0bde51693918a493dca77a252 /haddock-api/src
parent0ea2c4a892346d4fdd38c50cf234dbc5e23ac299 (diff)
Fix issue with operators being recognized as preprocessor directives.
Diffstat (limited to 'haddock-api/src')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
index 37cc5377..d927aa08 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
@@ -156,17 +156,17 @@ classify str
| "--" `isPrefixOf` str = TkComment
| "{-#" `isPrefixOf` str = TkPragma
| "{-" `isPrefixOf` str = TkComment
-classify (c:_)
+classify str@(c:_)
| isSpace c = TkSpace
| isDigit c = TkNumber
| c `elem` special = TkSpecial
+ | str `elem` glyphs = TkGlyph
+ | all (`elem` symbols) str = TkOperator
| c == '#' = TkCpp
| c == '"' = TkString
| c == '\'' = TkChar
classify str
| str `elem` keywords = TkKeyword
- | str `elem` glyphs = TkGlyph
- | all (`elem` symbols) str = TkOperator
| isIdentifier str = TkIdentifier
| otherwise = TkUnknown