Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 13572392 authored by POTTIER Francois's avatar POTTIER Francois

Rename a function.

parent 7edf2fe5
...@@ -163,12 +163,12 @@ let inline grammar = ...@@ -163,12 +163,12 @@ let inline grammar =
r r
in in
(* [chop_inline (prefix, suffix)] traverses the producers of the branch [b], (* [find_inlining_site (prefix, suffix)] traverses the producers of the branch
which already are decomposed under the form [List.rev prefix @ suffix]. [b], which already are decomposed under the form [List.rev prefix @ suffix].
It looks for the first nonterminal symbol that can be inlined away. If it It looks for the first nonterminal symbol that can be inlined away. If it
finds one, it inlines its branches into [b], which is why this function finds one, it inlines its branches into [b], which is why this function
can return several branches. Otherwise, it raises [NoInlining]. *) can return several branches. Otherwise, it raises [NoInlining]. *)
let rec chop_inline (prefix, suffix) = let rec find_inlining_site (prefix, suffix) =
match suffix with match suffix with
| [] -> | [] ->
raise NoInlining raise NoInlining
...@@ -187,9 +187,9 @@ let inline grammar = ...@@ -187,9 +187,9 @@ let inline grammar =
List.rev prefix, nt, r, id, xs List.rev prefix, nt, r, id, xs
end end
else else
chop_inline (x :: prefix, xs) find_inlining_site (x :: prefix, xs)
with Not_found -> with Not_found ->
chop_inline (x :: prefix, xs) find_inlining_site (x :: prefix, xs)
in in
(* Inline the non terminals that can be inlined in [b]. We use the (* Inline the non terminals that can be inlined in [b]. We use the
...@@ -197,7 +197,7 @@ let inline grammar = ...@@ -197,7 +197,7 @@ let inline grammar =
let rec expand_branch (b : branch) : branch ListMonad.m = let rec expand_branch (b : branch) : branch ListMonad.m =
try try
(* [c] is the identifier under which the callee is known. *) (* [c] is the identifier under which the callee is known. *)
let prefix, nt, p, c, suffix = chop_inline ([], b.producers) in let prefix, nt, p, c, suffix = find_inlining_site ([], b.producers) in
let p = expand_rule nt p in let p = expand_rule nt p in
(* These are the names of the producers in the host branch, (* These are the names of the producers in the host branch,
minus the producer that is being inlined away. *) minus the producer that is being inlined away. *)
......
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