Commit c35c545d authored by Judah Jacobson's avatar Judah Jacobson Committed by Marge Bot
Browse files

Add a -no-haddock flag.

This flag undoes the effect of a previous "-haddock" flag.  Having both flags makes it easier
for build systems to enable Haddock parsing in a set of global flags, but then disable it locally for
specific targets (e.g., third-party packages whose comments don't pass the validation in the latest GHC).

I added the flag to expected-undocumented-flags.txt since `-haddock` was alreadyin that list.
parent 2e82465f
Pipeline #16746 passed with stages
in 386 minutes and 59 seconds
......@@ -2571,6 +2571,7 @@ dynamic_flags_deps = [
, make_ord_flag defGhcFlag "ghcversion-file" (hasArg addGhcVersionFile)
, make_ord_flag defGhcFlag "main-is" (SepArg setMainIs)
, make_ord_flag defGhcFlag "haddock" (NoArg (setGeneralFlag Opt_Haddock))
, make_ord_flag defGhcFlag "no-haddock" (NoArg (unSetGeneralFlag Opt_Haddock))
, make_ord_flag defGhcFlag "haddock-opts" (hasArg addHaddockOpts)
, make_ord_flag defGhcFlag "hpcdir" (SepArg setOptHpcDir)
, make_ord_flag defGhciFlag "ghci-script" (hasArg addGhciScript)
......@@ -127,7 +127,6 @@
......@@ -1129,6 +1129,26 @@ Some flags only make sense for particular target platforms.
:ref:`native code generator <native-code-gen>`. The resulting compiled
code will only run on processors that support BMI2 (Intel Haswell and newer, AMD Excavator, Zen and newer).
.. index::
single: haddock
.. ghc-flag:: -haddock
:shortdesc: Make the parser more strict about Haddock comments.
:type: dynamic
:reverse: -no-haddock
:category: misc
By default, GHC ignores Haddock comments (``-- | ...`` and ``-- ^ ...``)
and does not check that they're associated with a valid term, such as a
top-level type-signature. With this flag GHC will parse Haddock comments
and include them in the interface file it produces.
Note that this flag makes GHC's parser more strict so programs which are
accepted without Haddock may be rejected with :ghc-flag:`-haddock`.
Miscellaneous flags
......@@ -11,3 +11,4 @@ test('haddockD001', normal, compile, [''])
test('haddockD002', normal, compile, [''])
test('haddockD003', normal, compile, [''])
test('haddockD004', normal, compile, [''])
test('haddockD005', normal, compile, ['-haddock -no-haddock'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment