summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore.hs
diff options
context:
space:
mode:
authorZubin Duggal <zubin@cmi.ac.in>2022-03-12 00:07:56 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-03-22 22:16:48 +0000
commit26819793f836f29f7c04ac0ac9c43d363eb5beb8 (patch)
tree406809b6a923bb84d1370874500017e69c6681d9 /compiler/GHC/HsToCore.hs
parentd45bb70178e044bc8b6e8215da7bc8ed0c95f2cb (diff)
downloadhaskell-wip/hi-haddock2021.tar.gz
hi haddock: Lex and store haddock docs in interface fileswip/hi-haddock2021
Names appearing in Haddock docstrings are lexed and renamed like any other names appearing in the AST. We currently rename names irrespective of the namespace, so both type and constructor names corresponding to an identifier will appear in the docstring. Haddock will select a given name as the link destination based on its own heuristics. This patch also restricts the limitation of `-haddock` being incompatible with `Opt_KeepRawTokenStream`. The export and documenation structure is now computed in GHC and serialised in .hi files. This can be used by haddock to directly generate doc pages without reparsing or renaming the source. At the moment the operation of haddock is not modified, that's left to a future patch. Updates the haddock submodule with the minimum changes needed.
Diffstat (limited to 'compiler/GHC/HsToCore.hs')
-rw-r--r--compiler/GHC/HsToCore.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs
index 78d43b164f..b95a5aebbe 100644
--- a/compiler/GHC/HsToCore.hs
+++ b/compiler/GHC/HsToCore.hs
@@ -225,7 +225,7 @@ deSugar hsc_env
; foreign_files <- readIORef th_foreign_files_var
- ; (doc_hdr, decl_docs, arg_docs) <- extractDocs tcg_env
+ ; docs <- extractDocs dflags tcg_env
; let mod_guts = ModGuts {
mg_module = mod,
@@ -255,9 +255,7 @@ deSugar hsc_env
mg_safe_haskell = safe_mode,
mg_trust_pkg = imp_trust_own_pkg imports,
mg_complete_matches = complete_matches,
- mg_doc_hdr = doc_hdr,
- mg_decl_docs = decl_docs,
- mg_arg_docs = arg_docs
+ mg_docs = docs
}
; return (msgs, Just mod_guts)
}}}}