aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-04-26 11:18:57 +0000
committersimonmar <unknown>2002-04-26 11:18:57 +0000
commit31c53d79c85274012725480b8d78d341f3affe06 (patch)
tree6c005e5816372d8a6455713debe6b3f0290ecf8c /src/Main.hs
parentbbd5fbab2ffebe759f20765a4dbd519b2d1381d8 (diff)
[haddock @ 2002-04-26 11:18:56 by simonmar]
- support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 0b8ac7d0..dd7aac64 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -31,6 +31,11 @@ import Char ( isSpace )
import IO
import IOExts
+#if __GLASGOW_HASKELL__ < 500
+import Regex
+import PackedString
+#endif
+
-----------------------------------------------------------------------------
-- Top-level stuff
@@ -64,7 +69,7 @@ options =
"directory in which to put the output files",
Option ['s'] ["source"] (ReqArg Flag_SourceURL "URL")
"base URL for links to source code",
- Option ['t'] ["heading"] (ReqArg Flag_Heading "HEADING")
+ Option ['t'] ["title"] (ReqArg Flag_Heading "TITLE")
"page heading",
Option ['v'] ["verbose"] (NoArg Flag_Verbose)
"be verbose",
@@ -418,8 +423,8 @@ buildEnv mod_map this_mod exported_names (HsImportDecl _ mod qual _ _)
expandDecl :: HsDecl -> [HsDecl]
expandDecl (HsTypeSig loc fs qt) = [ HsTypeSig loc [f] qt | f <- fs ]
-expandDecl (HsClassDecl loc ty decls)
- = [ HsClassDecl loc ty (concat (map expandDecl decls)) ]
+expandDecl (HsClassDecl loc ty fds decls)
+ = [ HsClassDecl loc ty fds (concat (map expandDecl decls)) ]
expandDecl d = [ d ]
-----------------------------------------------------------------------------
@@ -460,7 +465,7 @@ docsFromDecl (HsDataDecl loc ctxt nm tvs cons drvs)
= concat (map docsFromConDecl cons)
docsFromDecl (HsNewTypeDecl loc ctxt nm tvs con drvs)
= docsFromConDecl con
-docsFromDecl (HsClassDecl loc ty decls)
+docsFromDecl (HsClassDecl loc ty fds decls)
= collect Nothing "" decls
docsFromDecl _
= []
@@ -569,6 +574,13 @@ moduleHeaderRE = mkRegexWithOpts
-- this at some point (perhaps have a separator between the
-- portability field and the module documentation?).
+#if __GLASGOW_HASKELL__ < 500
+mkRegexWithOpts :: String -> Bool -> Bool -> Regex
+mkRegexWithOpts s single_line case_sensitive
+ = unsafePerformIO (re_compile_pattern (packString s)
+ single_line case_sensitive)
+#endif
+
-- -----------------------------------------------------------------------------
-- Named documentation