diff options
author | Takenobu Tani <takenobu.hs@gmail.com> | 2019-10-21 20:35:22 +0900 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-05 02:45:31 -0500 |
commit | 7c28087a479e5ce0d3113aa4ebb9068d9e2a5a7b (patch) | |
tree | 017a4ca7a986d79c7d43c8bc85d34a5a058f0f1b | |
parent | 120f2e5343d5ccd3ad117d530018b75302c6482b (diff) | |
download | haskell-7c28087a479e5ce0d3113aa4ebb9068d9e2a5a7b.tar.gz |
users-guide: Improve documentaion of CPP extension
Currently, the description of CPP extension is given in the section of
command-line options.
Therefore, it is a little difficult to understand that it is a language
extension.
This commit explicitly adds a description for it.
[skip ci]
-rw-r--r-- | docs/users_guide/phases.rst | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index f0479596c1..d0afe80a23 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -233,6 +233,19 @@ Options affecting the C pre-processor :since: 6.8.1 + The :extension:`CPP` language extension enables the C pre-processor. + This can be turned into a command-line flag by prefixing it with + ``-X``; For example: + + .. code-block:: sh + + $ ghc -XCPP foo.hs + + The :extension:`CPP` language extension can also be enabled using + the :ref:`LANGUAGE <language-pragma>` pragma; For example: :: + + {-# LANGUAGE CPP #-} + .. index:: single: pre-processing: cpp single: C pre-processor options @@ -243,8 +256,8 @@ Options affecting the C pre-processor :type: dynamic :category: cpp - The C pre-processor :command:`cpp` is run over your Haskell code only if - the ``-cpp`` option -cpp option is given. Unless you are building a + The C pre-processor :command:`cpp` is run over your Haskell code if + the ``-cpp`` option or ``-XCPP`` extension are given. Unless you are building a large system with significant doses of conditional compilation, you really shouldn't need it. |