Mentions légales du service

Skip to content

Embed standard.mly directly inside menhir

Nicolás Ojeda Bär requested to merge embed_standard_mly into master

As discussed, I propose to embed standard.mly directly inside menhir. The upside is that menhir no longer needs to find this file at runtime, which simplifies matters (in particular, a future dune port). Also, there is no danger of using an outdated standard.mly.

The changes in this patch are:

  1. Define a generic rule in myocamlbuild.ml to produce a file XXX_mly.ml from XXX.mly. The contents of the produced file are exactly
    let contents = "<contents of XXX.mly>"
  2. Modify grammar loading logic to load the standard library standard.mly directly from Standard_mly.contents. Note that the dummy filename <standard.mly> is used at this point. This filename ends up in line directives in the generated OCaml parsers.
  3. Remove support for --stdlib and MENHIR_STDLIB (the command line flag is left in place for backwards-compatibility but is ignored)
  4. Adapt the distribution script so that standard.mly is no longer installed
  5. Adapt the manual
Edited by Nicolás Ojeda Bär

Merge request reports