Anonymous avatar Anonymous committed 3617cef

fix PR#5763: ocamlbuild does not give correct flags when running menhir

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12946 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

Comments (0)

Files changed (2)

 - PR#5738: first class module patterns not handled by ocamldep
 - PR#5747: 'unused open' warning not given when compiling with -annot
 - PR#5758: Compiler bug when matching on floats
+- PR#5763: ocamlbuild does not give correct flags when running menhir
 
 Internals:
 - Moved debugger/envaux.ml to typing/envaux.ml to publish env_of_only_summary

ocamlbuild/ocaml_tools.ml

 let menhir mly env build =
   let mly = env mly in
   let menhir = if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc in
+  let tags = tags_of_pathname mly in
+  let ocamlc_tags = tags++"ocaml"++"byte"++"compile" in
+  let menhir_tags = tags++"ocaml"++"parser"++"menhir" in
   Ocaml_compiler.prepare_compile build mly;
   Cmd(S[menhir;
-        A"--ocamlc"; Quote(S[!Options.ocamlc; ocaml_include_flags mly]);
-        T(tags_of_pathname mly++"ocaml"++"parser"++"menhir");
-        A"--infer"; Px mly])
+        A"--ocamlc"; Quote(S[!Options.ocamlc; T ocamlc_tags; ocaml_include_flags mly]);
+        T menhir_tags; A"--infer"; Px mly])
 
 let ocamldoc_c tags arg odoc =
   let tags = tags++"ocaml" in
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.