Commit 68d797a1 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 #16524 failed with stages
in 131 minutes and 52 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 @@
......@@ -1129,6 +1129,24 @@ 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. 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
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment