Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
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
{
rule
with
branches
=
rule
.
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