Commit 88e3ddc7 authored by POTTIER Francois's avatar POTTIER Francois

Remove the second return value of [NonTerminalDefinitionInlining.inline].

parent 7923af94
......@@ -172,7 +172,7 @@ let grammar =
let grammar =
if Settings.inline then begin
let grammar, (_ : bool) = NonTerminalDefinitionInlining.inline grammar in
let grammar = NonTerminalDefinitionInlining.inline grammar in
(* 2018/05/23 Removed the warning that was issued when %inline was used
but --infer was turned off. Most people should use ocamlbuild or dune
anyway. *)
......
......@@ -101,8 +101,6 @@ let inline grammar =
prefix
in
let use_inline = ref false in
(* This table associates a color to each non terminal that can be expanded. *)
let expanded_non_terminals =
Hashtbl.create 13
......@@ -181,7 +179,7 @@ let inline grammar =
try
(* [c] is the identifier under which the callee is known. *)
let prefix, p, nt, c, suffix = find_inline_producer b in
use_inline := true;
(* use_inline := true; *)
(* Inline a branch of [nt] at position [prefix] ... [suffix] in
the branch [b]. *)
let inline_branch pb =
......@@ -368,4 +366,4 @@ let inline grammar =
rules = StringMap.filter (fun _ r -> not r.inline_flag) expanded_rules;
types = StringMap.filter (fun k _ -> useful k) grammar.types;
on_error_reduce = StringMap.filter (fun k _ -> useful_warn k) grammar.on_error_reduce;
}, !use_inline
}
......@@ -11,7 +11,8 @@
(* *)
(******************************************************************************)
(** [inline g] traverses the rules of [g] and inlines the non terminal
definitions that are marked with [%inline]. It returns a pair of the transformed
grammar and a flag that tells whether any inlining was actually done. *)
val inline: UnparameterizedSyntax.grammar -> UnparameterizedSyntax.grammar * bool
open UnparameterizedSyntax
(** [inline g] traverses the grammar [g] and inlines the nonterminal symbol
definitions that are marked [%inline]. *)
val inline: grammar -> grammar
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