Commit 4ad2f448 authored by Judah Jacobson's avatar Judah Jacobson

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 dbea7e9d
Pipeline #16523 failed with stages
in 20 minutes and 35 seconds
......@@ -3245,6 +3245,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)
......
......@@ -147,6 +147,7 @@
-no-auto
-no-auto-all
-no-caf-all
-no-haddock
-no-keep-hi-file
-no-keep-o-file
-no-link
......
......@@ -1129,6 +1129,23 @@ 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).
Haddock
-------
.. 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.
This flag makes GHC's parser more strict, so that it rejects source files that
would be rejected by the ``haddock` program itself.
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