diff --git a/doc/index.rst b/doc/index.rst index 4928bf37..2e42d9d7 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -19,5 +19,6 @@ Welcome to jbuilder's documentation! usage advanced-topics configurator + menhir faq known-issues diff --git a/doc/jbuild.rst b/doc/jbuild.rst index ea0a3618..1da079f7 100644 --- a/doc/jbuild.rst +++ b/doc/jbuild.rst @@ -521,30 +521,8 @@ To use a different rule mode, use the long form: menhir ------ -The basic form for defining menhir parsers (analogous to ocamlyacc) is: - -.. code:: scheme - - (menhir - ((modules ( ...)))) - -Modular parsers can be defined by adding a ``merge_into`` field. This correspond -to the ``--base`` command line option of ``menhir``. With this option, a single -parser named ``base_name`` is generated. - -.. code:: scheme - - (menhir - ((merge_into ) - (modules ( ...)))) - -Extra flags can be passed to menhir using the ``flags`` flag: - -.. code:: scheme - - (menhir - ((flags ( ...)) - (modules ( ...)))) +A ``menhir`` stanza is available to support the menhir_ parser generator. See +the :ref:`menhir-main` section for details. alias ----- diff --git a/doc/menhir.rst b/doc/menhir.rst new file mode 100644 index 00000000..03c4de40 --- /dev/null +++ b/doc/menhir.rst @@ -0,0 +1,32 @@ +.. _menhir-main: + +****** +Menhir +****** + +The basic form for defining menhir_ parsers (analogous to ocamlyacc) is: + +.. code:: scheme + + (menhir + ((modules ( ...)))) + +Modular parsers can be defined by adding a ``merge_into`` field. This correspond +to the ``--base`` command line option of ``menhir``. With this option, a single +parser named ``base_name`` is generated. + +.. code:: scheme + + (menhir + ((merge_into ) + (modules ( ...)))) + +Extra flags can be passed to menhir using the ``flags`` flag: + +.. code:: scheme + + (menhir + ((flags ( ...)) + (modules ( ...)))) + +.. _menhir: https://gitlab.inria.fr/fpottier/menhir diff --git a/src/module.mli b/src/module.mli index c325af1d..5fcc90e0 100644 --- a/src/module.mli +++ b/src/module.mli @@ -1,7 +1,7 @@ open! Import module Name : sig - type t = private string + type t val add_suffix : t -> string -> t