Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
POTTIER Francois
menhir
Commits
1df26729
Commit
1df26729
authored
Nov 14, 2018
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate [expand_rule].
parent
379675e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
src/nonTerminalDefinitionInlining.ml
src/nonTerminalDefinitionInlining.ml
+5
-9
No files found.
src/nonTerminalDefinitionInlining.ml
View file @
1df26729
...
...
@@ -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
=
try
(
match
expanded_state
k
with
(
match
expanded_state
symbol
with
|
BeingExpanded
->
Error
.
error
r
.
positions
"there is a cycle in the definition of %s."
k
r
ule
.
positions
"there is a cycle in the definition of %s."
symbol
|
Expanded
r
->
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
{
r
ule
with
branches
=
r
ule
.
branches
>>=
expand_branch
}
in
(* If we are in Coq mode, %inline is forbidden. *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment