Commit afbcff14 authored by POTTIER Francois's avatar POTTIER Francois

Avoid leading "|" when printing a rule (--only-preprocess).

parent 76a3d9a1
......@@ -186,8 +186,10 @@ let print_rules mode b g =
in
List.iter (fun (nt, r) ->
Printf.fprintf b "\n%s:\n" (Misc.normalize nt);
let first = ref true in
List.iter (fun br ->
Printf.fprintf b "| ";
(* Menhir accepts a leading "|", but bison does not. Let's not print it. *)
if !first then first := false else Printf.fprintf b "| ";
print_branch mode b br
) r.branches
) ordered_rules
......
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