diff options
author | Zubin Duggal <zubin@cmi.ac.in> | 2022-03-12 00:07:56 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-23 13:39:39 -0400 |
commit | b91798be48d9fa02610b419ccea15a7dfd663823 (patch) | |
tree | fb87654ccd4a1e92e8c7a15bf454a867460869a3 /testsuite/tests/ghci | |
parent | 52ffd38c610f418ee1d1a549cfdfdaa11794ea40 (diff) | |
download | haskell-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 'testsuite/tests/ghci')
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci065.stdout | 26 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci066.stdout | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/testsuite/tests/ghci/scripts/ghci065.stdout b/testsuite/tests/ghci/scripts/ghci065.stdout index 39b990b04c..e4048832cc 100644 --- a/testsuite/tests/ghci/scripts/ghci065.stdout +++ b/testsuite/tests/ghci/scripts/ghci065.stdout @@ -1,32 +1,32 @@ Data1 :: * -- Type constructor defined at ghci065.hs:14:1 - This is the haddock comment of a data declaration for Data1. +-- | This is the haddock comment of a data declaration for Data1. Val2a :: Data2 -- Data constructor defined at ghci065.hs:16:14 - This is the haddock comment of a data value for Val2a +-- ^ This is the haddock comment of a data value for Val2a Val2b :: Data2 -- Data constructor defined at ghci065.hs:17:14 - This is the haddock comment of a data value for Val2b +-- ^ This is the haddock comment of a data value for Val2b Data3 :: * -- Type constructor defined at ghci065.hs:20:1 - This is the haddock comment of a data declaration for Data3. +-- | This is the haddock comment of a data declaration for Data3. Data4 :: Int -> Data4 -- Data constructor defined at ghci065.hs:25:3 - This is the haddock comment of a data constructor for Data4. +-- | This is the haddock comment of a data constructor for Data4. dupeField :: DupeFields2 -> Int -- Identifier defined at ghci065.hs:32:9 - This is the second haddock comment of a duplicate record field. +-- ^ This is the second haddock comment of a duplicate record field. dupeField :: DupeFields1 -> Int -- Identifier defined at ghci065.hs:28:9 - This is the first haddock comment of a duplicate record field. +-- ^ This is the first haddock comment of a duplicate record field. func1 :: Int -> Int -> Int -- Identifier defined at ghci065.hs:41:1 - This is the haddock comment of a function declaration for func1. +-- | This is the haddock comment of a function declaration for func1. <has no documentation> func3 :: Int -> Int -> Int -- Identifier defined at ghci065.hs:50:1 - This is the haddock comment of a function declaration for func3. - Here's multiple line comment for func3. +-- | This is the haddock comment of a function declaration for func3. +-- Here's multiple line comment for func3. PatSyn :: Int -- Pattern synonym defined at ghci065.hs:54:1 - This is the haddock comment of a pattern synonym +-- | This is the haddock comment of a pattern synonym TyCl :: k -> Constraint -- Class defined at ghci065.hs:57:1 - This is the haddock comment of a type class +-- | This is the haddock comment of a type class TyFam :: * -> * -- Type constructor defined at ghci065.hs:60:1 - This is the haddock comment of a type family +-- | This is the haddock comment of a type family diff --git a/testsuite/tests/ghci/scripts/ghci066.stdout b/testsuite/tests/ghci/scripts/ghci066.stdout index f56daddbdb..0f38f9c386 100644 --- a/testsuite/tests/ghci/scripts/ghci066.stdout +++ b/testsuite/tests/ghci/scripts/ghci066.stdout @@ -1,3 +1,3 @@ GHC.Prim.byteSwap# :: GHC.Prim.Word# -> GHC.Prim.Word# -- Identifier defined in ‘GHC.Prim’ -Swap bytes in a word. +-- |Swap bytes in a word. |