aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-05 15:12:40 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-30 22:37:48 +0200
commite5bd5d39550692f936c973637f8ec8d314919359 (patch)
tree5f47ae4d202beab3226f46f81fa808975cf166ac /haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
parentffd0e8028f15f3616f1b3eaaf98459c0c75c6313 (diff)
Add support for recognizing compiler pragmas in source parser.
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
index 29edb4c3..0e1ad5b2 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
@@ -35,6 +35,7 @@ data TokenType
| TkSpace
| TkComment
| TkCpp
+ | TkPragma
| TkUnknown
parse :: String -> [Token]
@@ -92,6 +93,7 @@ tokenize =
classify :: String -> TokenType
classify str
| "--" `isPrefixOf` str = TkComment
+ | "{-#" `isPrefixOf` str = TkPragma
| "{-" `isPrefixOf` str = TkComment
classify (c:_)
| isSpace c = TkSpace