diff options
author | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-06-05 14:39:28 +0200 |
---|---|---|
committer | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-06-30 22:37:48 +0200 |
commit | 01a2e7c5ab873c0041624a6ec0b0a54eb7da60cc (patch) | |
tree | 5f0e084c1e5ead30c735fe06841b4bc7bd9afdf0 | |
parent | 1a43f35e2dacc9837f9762fd211d63ae6cc7b4a3 (diff) |
Fix identifier recognition in Haskell source parser.
-rw-r--r-- | haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 7a162f6d..9d58728f 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -163,6 +163,9 @@ symbols :: [Char] symbols = "!#$%&*+./<=>?@\\^|-~:" isIdentifier :: String -> Bool -isIdentifier (c:str) - | isLetter c = all (\c' -> isAlphaNum c' || c == '\'') str +isIdentifier (s:str) + | (isLower' s || isUpper s) && all isAlphaNum' str = True + where + isLower' c = isLower c || c == '_' + isAlphaNum' c = isAlphaNum c || c == '_' || c == '\'' isIdentifier _ = False |