[commit: ghc] ghc-8.0: users-guide: Begin documenting --frontend (c94ef29)

git at git.haskell.org git at git.haskell.org
Mon Jan 18 12:24:42 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/c94ef2928a99cede690be7357e39d3274255e1e4/ghc

>---------------------------------------------------------------

commit c94ef2928a99cede690be7357e39d3274255e1e4
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Jan 18 10:11:25 2016 +0100

    users-guide: Begin documenting --frontend
    
    See #11448.
    
    (cherry picked from commit 1dcb7d51a4dbe459e00ef22272b0bdd57cfcde4a)


>---------------------------------------------------------------

c94ef2928a99cede690be7357e39d3274255e1e4
 docs/users_guide/extending_ghc.rst     |  2 +-
 docs/users_guide/using.rst             | 10 +++++++++-
 utils/mkUserGuidePart/Options/Modes.hs |  8 +++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst
index 74bba91..17d061e 100644
--- a/docs/users_guide/extending_ghc.rst
+++ b/docs/users_guide/extending_ghc.rst
@@ -590,7 +590,7 @@ A frontend plugin allows you to add new major modes to GHC.  You may prefer
 this over a traditional program which calls the GHC API, as GHC manages a lot
 of parsing flags and administrative nonsense which can be difficult to
 manage manually.  To load a frontend plugin exported by ``Foo.FrontendPlugin``,
-we just invoke GHC as follows:
+we just invoke GHC with the :ghc-flag:`--frontend` flag as follows:
 
 .. code-block:: none
 
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index a600a13..91b6291 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -281,12 +281,20 @@ The available mode flags are:
 .. ghc-flag:: -M
 
     .. index::
-       single: dependency-generation mode; of GHC
+        single: dependency-generation mode; of GHC
 
     Dependency-generation mode. In this mode, GHC can be used to
     generate dependency information suitable for use in a ``Makefile``.
     See :ref:`makefile-dependencies`.
 
+.. ghc-flag:: --frontend <module>
+
+    .. index::
+        single: frontend plugins; using
+
+    Run GHC using the given frontend plugin. See :ref:`frontend_plugins` for
+    details.
+
 .. ghc-flag:: --mk-dll
 
     .. index::
diff --git a/utils/mkUserGuidePart/Options/Modes.hs b/utils/mkUserGuidePart/Options/Modes.hs
index 57aaef2..792ee9f 100644
--- a/utils/mkUserGuidePart/Options/Modes.hs
+++ b/utils/mkUserGuidePart/Options/Modes.hs
@@ -32,10 +32,16 @@ modeOptions =
          }
   , flag { flagName = "-M"
          , flagDescription =
-           "denerate dependency information suitable for use in a "++
+           "generate dependency information suitable for use in a "++
            "``Makefile``; see :ref:`makefile-dependencies` for details."
          , flagType = ModeFlag
          }
+  , flag { flagName = "--frontend ⟨module⟩"
+         , flagDescription =
+           "run GHC with the given frontend plugin; see "++
+           ":ref:`frontend_plugins` for details."
+         , flagType = ModeFlag
+         }
   , flag { flagName = "--supported-extensions, --supported-languages"
          , flagDescription = "display the supported language extensions"
          , flagType = ModeFlag



More information about the ghc-commits mailing list