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
3c289f91
Commit
3c289f91
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-06-27 22:12:44 by afrisch] Reference dans un sens
Original author: afrisch Date: 2004-06-27 22:12:44+00:00
parent
ac54e1b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
ocamliface/mlstub.ml
View file @
3c289f91
...
...
@@ -44,6 +44,7 @@ and typ_descr = function
|
Abstract
"char"
->
Builtin_defs
.
char_latin1
|
Abstract
"string"
->
Builtin_defs
.
string_latin1
|
Builtin
(
"list"
,
[
t
])
->
Types
.
descr
(
Sequence
.
star_node
(
typ
t
))
|
Builtin
(
"Pervasives.ref"
,
[
t
])
->
Builtin_defs
.
ref_type
(
typ
t
)
|
_
->
assert
false
and
pvariant
=
function
...
...
@@ -170,6 +171,8 @@ and to_cd_descr e = function
|
Builtin
(
"list"
,
[
t
])
->
(* Value.sequence_rev (List.rev_map fun_t <...>) *)
<:
expr
<
Value
.
sequence_rev
(
List
.
rev_map
$
lid
:
to_cd_fun
t
$
$
e
$
)
>>
|
Builtin
(
"Pervasives.ref"
,
[
t
])
->
failwith
"to_cd: Reference. TODO"
|
_
->
assert
false
and
tuple_to_cd
tl
vars
=
List
.
map2
(
fun
t
id
->
to_cd
<:
expr
<
$
lid
:
id
$
>>
t
)
tl
vars
...
...
@@ -269,6 +272,11 @@ and to_ml_descr e = function
|
Builtin
(
"list"
,
[
t
])
->
(* List.rev_map fun_t (Value.get_sequence_rev <...> *)
<:
expr
<
List
.
rev_map
$
lid
:
to_ml_fun
t
$
(
Value
.
get_sequence_rev
$
e
$
)
>>
|
Builtin
(
"Pervasives.ref"
,
[
t
])
->
(* ref t(Eval.eval_apply (Value.get_field <...> "get") Value.nil) *)
let
e
=
<:
expr
<
Value
.
get_field
$
e
$
$
label_ascii
"get"
$
>>
in
let
e
=
<:
expr
<
Eval
.
eval_apply
$
e
$
Value
.
nil
>>
in
<:
expr
<
Pervasives
.
ref
$
to_ml
e
t
$
>>
|
_
->
assert
false
and
tuple_to_ml
tl
vars
=
List
.
map2
(
fun
t
id
->
to_ml
<:
expr
<
$
lid
:
id
$
>>
t
)
tl
vars
...
...
ocamliface/mltypes.ml
View file @
3c289f91
...
...
@@ -78,7 +78,7 @@ let new_slot () =
let
builtins
=
List
.
fold_left
(
fun
m
x
->
StringMap
.
add
x
()
m
)
StringMap
.
empty
[
"list"
]
[
"list"
;
"Pervasives.ref"
]
let
rec
unfold
seen
constrs
ty
=
try
...
...
@@ -155,7 +155,7 @@ let unsupported s =
raise
(
Error
(
Printf
.
sprintf
"Unsupport feature (%s) found in .cmi"
s
))
let
read_cmi
name
=
Config
.
load_path
:=
!
Librarian
.
obj_path
;
Config
.
load_path
:=
Config
.
standard_library
::
!
Librarian
.
obj_path
;
let
filename
=
Misc
.
find_in_path_uncap
!
Config
.
load_path
(
name
^
".cmi"
)
in
let
sg
=
Env
.
read_signature
name
filename
in
ocaml_env
:=
Env
.
add_signature
sg
Env
.
initial
;
...
...
runtime/value.ml
View file @
3c289f91
...
...
@@ -574,3 +574,4 @@ let get_field v l =
match
v
with
|
Record
fields
->
LabelMap
.
assoc
l
fields
|
_
->
raise
Not_found
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