Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
eb9f0284
Commit
eb9f0284
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2003-03-16 13:04:06 by cvscast] Empty log message
Original author: cvscast Date: 2003-03-16 13:04:06+00:00
parent
a6e993a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
runtime/run_dispatch.ml
View file @
eb9f0284
...
...
@@ -17,6 +17,7 @@ let blit a1 ofs1 a2 ofs2 len =
for
i
=
0
to
len
-
1
do
Array
.
unsafe_set
a2
(
ofs2
+
i
)
(
Array
.
unsafe_get
a1
(
ofs1
+
i
))
done
(* important to do this in the increasing order ... *)
let
ensure_room
n
=
...
...
@@ -32,6 +33,7 @@ let make_result_prod v1 r1 v2 r2 v (code,r) =
if
n
=
0
then
code
else
(
ensure_room
n
;
let
buf
=
!
buffer
in
let
c
=
!
cursor
in
for
a
=
0
to
n
-
1
do
let
x
=
match
Array
.
unsafe_get
r
a
with
|
Catch
->
v
...
...
@@ -42,9 +44,9 @@ let make_result_prod v1 r1 v2 r2 v (code,r) =
Pair
((
if
(
i
<
0
)
then
v1
else
buf
.
(
r1
+
i
))
,
(
if
(
j
<
0
)
then
v2
else
buf
.
(
r2
+
j
)))
in
buf
.
(
!
cursor
+
a
)
<-
x
buf
.
(
c
+
a
)
<-
x
done
;
if
r1
<>
!
cursor
then
blit
buf
!
cursor
buf
r1
n
;
if
r1
<>
c
then
blit
buf
c
buf
r1
n
;
cursor
:=
r1
+
n
;
(* clean space for GC ? *)
code
)
...
...
@@ -186,7 +188,7 @@ and run_disp_record1 other v1 rem = function
and
run_disp_record2
other
v1
r1
rem
=
function
|
Impossible
->
assert
false
|
Ignore
r
->
make_result_prod
v1
r1
Absent
!
cursor
Absent
r
|
Ignore
r
->
make_result_prod
v1
r1
Absent
0
Absent
r
|
TailCall
d2
->
run_disp_record_loop
other
rem
d2
|
Dispatch
(
d2
,
b2
)
->
let
r2
=
!
cursor
in
...
...
@@ -216,7 +218,7 @@ and run_disp_string_char d ch =
and
run_disp_string2
r1
i
j
s
q
=
function
|
Impossible
->
assert
false
|
Ignore
r
->
make_result_string
i
j
s
q
r1
!
cursor
r
make_result_string
i
j
s
q
r1
0
r
|
TailCall
d2
->
run_disp_string_loop
i
j
s
q
d2
|
Dispatch
(
d2
,
b2
)
->
let
r2
=
!
cursor
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