Commit 159fe729 authored by POTTIER Francois's avatar POTTIER Francois

Modified the build rules for [calc-two] so as to avoid unused token warnings.

parent a4611cf8
<tokens.mlypack>: only_tokens
<algebraic.mlypack>: external_tokens(Tokens)
<reverse.mlypack>: external_tokens(Tokens)
<reverse.mly>: unused_token(LPAREN)
<reverse.mly>: unused_token(RPAREN)
open Ocamlbuild_plugin
open Command
(* Define ocamlbuild flags [only_tokens] and [external_tokens(Foo)] and
[unused_token(Bar)] which correspond to menhir's [--only-tokens] and
[--external-tokens Foo] and [--unused-token Bar]. When they are used, these
flags should be passed both to [menhir] and to [menhir --raw-depend]. *)
let menhir_flags() =
(* Define two ocamlbuild flags [only_tokens] and [external_tokens(Foo)]
which correspond to menhir's [--only-tokens] and [--external-tokens Foo].
When they are used, these flags should be passed both to [menhir] and to
[menhir --raw-depend]. *)
List.iter (fun mode ->
flag [ mode; "only_tokens" ] (S[A "--only-tokens"]);
pflag [ mode ] "external_tokens" (fun name ->
S[A "--external-tokens"; A name]
);
pflag [ mode ] "unused_token" (fun name ->
S[A "--unused-token"; A name]
)
) [ "menhir"; "menhir_ocamldep" ]
let () =
dispatch (fun event ->
match event with
| After_rules ->
menhir_flags()
menhir_flags()
| _ -> ()
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment