summaryrefslogtreecommitdiff
path: root/hadrian/src
diff options
context:
space:
mode:
authorZubin Duggal <zubin@cmi.ac.in>2022-03-12 00:07:56 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-23 13:39:39 -0400
commitb91798be48d9fa02610b419ccea15a7dfd663823 (patch)
treefb87654ccd4a1e92e8c7a15bf454a867460869a3 /hadrian/src
parent52ffd38c610f418ee1d1a549cfdfdaa11794ea40 (diff)
downloadhaskell-b91798be48d9fa02610b419ccea15a7dfd663823.tar.gz
hi haddock: Lex and store haddock docs in interface files
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 'hadrian/src')
-rw-r--r--hadrian/src/Rules/SourceDist.hs1
-rw-r--r--hadrian/src/Rules/ToolArgs.hs1
-rw-r--r--hadrian/src/Settings/Builders/Haddock.hs1
3 files changed, 2 insertions, 1 deletions
diff --git a/hadrian/src/Rules/SourceDist.hs b/hadrian/src/Rules/SourceDist.hs
index c98069f073..f37e26ade8 100644
--- a/hadrian/src/Rules/SourceDist.hs
+++ b/hadrian/src/Rules/SourceDist.hs
@@ -152,6 +152,7 @@ prepareTree dest = do
, (Stage0, compiler, "GHC/Cmm/Lexer.x", "GHC/Cmm/Lexer.hs")
, (Stage0, compiler, "GHC/Parser.y", "GHC/Parser.hs")
, (Stage0, compiler, "GHC/Parser/Lexer.x", "GHC/Parser/Lexer.hs")
+ , (Stage0, compiler, "GHC/Parser/HaddockLex.x", "GHC/Parser/HaddockLex.hs")
, (Stage0, hpcBin, "HpcParser.y", "HpcParser.hs")
, (Stage0, genprimopcode, "Parser.y", "Parser.hs")
, (Stage0, genprimopcode, "Lexer.x", "Lexer.hs")
diff --git a/hadrian/src/Rules/ToolArgs.hs b/hadrian/src/Rules/ToolArgs.hs
index 1ed15d8f05..eff690cd9b 100644
--- a/hadrian/src/Rules/ToolArgs.hs
+++ b/hadrian/src/Rules/ToolArgs.hs
@@ -70,6 +70,7 @@ allDeps = do
need [ root -/- dir -/- "GHC" -/- "Settings" -/- "Config.hs" ]
need [ root -/- dir -/- "GHC" -/- "Parser.hs" ]
need [ root -/- dir -/- "GHC" -/- "Parser" -/- "Lexer.hs" ]
+ need [ root -/- dir -/- "GHC" -/- "Parser" -/- "HaddockLex.hs" ]
need [ root -/- dir -/- "GHC" -/- "Cmm" -/- "Parser.hs" ]
need [ root -/- dir -/- "GHC" -/- "Cmm" -/- "Lexer.hs" ]
diff --git a/hadrian/src/Settings/Builders/Haddock.hs b/hadrian/src/Settings/Builders/Haddock.hs
index 5aeba0c805..6dc4dbde68 100644
--- a/hadrian/src/Settings/Builders/Haddock.hs
+++ b/hadrian/src/Settings/Builders/Haddock.hs
@@ -50,7 +50,6 @@ haddockBuilderArgs = mconcat
, arg $ "-B" ++ root -/- stageString Stage1 -/- "lib"
, arg $ "--lib=" ++ root -/- stageString Stage1 -/- "lib"
, arg $ "--odir=" ++ takeDirectory output
- , arg "--no-tmp-comp-dir"
, arg $ "--dump-interface=" ++ output
, arg "--html"
, arg "--hyperlinked-source"