Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
6c6982b4
Commit
6c6982b4
authored
Nov 11, 2015
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorization.
parent
fcde90fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
src/codeBackend.ml
src/codeBackend.ml
+10
-11
No files found.
src/codeBackend.ml
View file @
6c6982b4
...
...
@@ -1181,25 +1181,26 @@ let reducebody prod =
exists and has an [endp] field at offset 1. Yes, we live
dangerously. You only live once. *)
let
symbol
=
Symbol
.
N
nt
let
extract
x
=
(* Extract the end position (i.e., the field at offset 1) in the top
stack cell and bind it to the variable [x]. *)
PTuple
[
PWildcard
;
PVar
x
]
,
EMagic
(
EVar
stack
)
in
let
symbol
=
Symbol
.
N
nt
in
let
posbindings
action
=
let
bind_startp
=
Invariant
.
startp
symbol
in
elementif
(
Action
.
has_beforeend
action
)
(
(* Extract the field at offset 1 in the top stack cell. *)
PTuple
[
PWildcard
;
PVar
beforeendp
]
,
EMagic
(
EVar
stack
)
(
extract
beforeendp
)
@
elementif
bind_startp
(
if
length
>
0
then
PVar
startp
,
EVar
(
Printf
.
sprintf
"_startpos_%s_"
ids
.
(
0
))
else
(* Extract the field at offset 1 in the top stack cell. *)
PTuple
[
PWildcard
;
PVar
startp
]
,
EMagic
(
EVar
stack
)
extract
startp
)
@
elementif
(
Invariant
.
endp
symbol
)
(
if
length
>
0
then
...
...
@@ -1209,9 +1210,7 @@ let reducebody prod =
PVar
endp
,
EVar
startp
else
(* Extract the field at offset 1 in the top stack cell. *)
PTuple
[
PWildcard
;
PVar
endp
]
,
EMagic
(
EVar
stack
)
extract
endp
)
in
...
...
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