Commit 1df26729 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Eliminate [expand_rule].

parent 379675e8
......@@ -366,21 +366,17 @@ let inline grammar =
and expand_symbol symbol : rule =
let rule = find grammar symbol in
expand_rule symbol rule
(* Expand a rule if necessary. *)
and expand_rule k r =
(match expanded_state k with
(match expanded_state symbol with
| BeingExpanded ->
"there is a cycle in the definition of %s." k
"there is a cycle in the definition of %s." symbol
| Expanded r ->
with Not_found ->
mark_as_being_expanded k;
mark_as_expanded k { r with branches = r.branches >>= expand_branch }
mark_as_being_expanded symbol;
mark_as_expanded symbol { rule with branches = rule.branches >>= expand_branch }
(* If we are in Coq mode, %inline is forbidden. *)
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