Commit 4b173586 authored by Pietro Abate's avatar Pietro Abate

[r2005-04-01 15:08:20 by afrisch] Empty log message

Original author: afrisch
Date: 2005-04-01 15:08:21+00:00
parent 9c4f6eb6
......@@ -50,7 +50,9 @@ SRC= \
cduce/runtime/run_dispatch.mli \
cduce/runtime/run_dispatch.ml \
cduce/runtime/serial.mli \
cduce/runtime/serial.ml
cduce/runtime/serial.ml \
cduce/runtime/xml_loader.mli \
cduce/runtime/xml_loader.ml
ML_SRC=$(filter %.ml,$(SRC))
......
......@@ -134,20 +134,3 @@ let load_html s =
(Netconversion.convert ~in_enc:`Enc_iso88591
~out_enc:`Enc_utf8) doc in
val_of_docs doc
......@@ -144,8 +144,11 @@ module G = struct
let record chunk i vs =
Value.mk_record (LABA.get (fun x -> x) chunk.laba i) vs
let constr_const chunk i =
TAG.get (fun x -> Value.Atom x) chunk.tag i
let constr chunk i vs =
Value.ocaml2cduce_constr (TAG.get (fun x -> Value.Atom x) chunk.tag i) vs
Value.ocaml2cduce_constr (constr_const chunk i) vs
let dconstr chunk i v =
Value.cduce2ocaml_constr (TAGA.get
......
......@@ -22,6 +22,7 @@ module G : sig
val typ: chunk -> int -> Types.t
val record: chunk -> int -> Value.t array -> Value.t
val constr: chunk -> int -> Value.t array -> Value.t
val constr_const: chunk -> int -> Value.t
val dconstr: chunk -> int -> Value.t -> Obj.t
end
......
......@@ -64,6 +64,13 @@ let sequence_of_array a =
else let i = pred i in aux (Pair (a.(i), accu)) i in
aux nil (Array.length a)
let tuple_of_array a =
let rec aux accu i =
if (i = 0) then accu
else let i = pred i in aux (Pair (a.(i), accu)) i in
let n = Array.length a in
aux a.(n) (pred n)
let concat v1 v2 =
match (v1,v2) with
| (Atom _, v) | (v, Atom _) -> v
......@@ -769,18 +776,17 @@ let rec cduce2ocaml_list f v =
let no_attr = Record LabelMap.empty
let ocaml2cduce_constr tag va = Xml (tag, no_attr, sequence_of_array va)
let ocaml2cduce_constr tag va =
Xml (tag, no_attr, sequence_of_array va)
let cduce2ocaml_constr m = function
let rec cduce2ocaml_constr m = function
| Atom v ->
Obj.repr (Atoms.get_map v m)
| Xml (Atom v,_,f) | XmlNs (Atom v,_,f,_) ->
let tag = Atoms.get_map v m in
(match get_sequence f with
| [] ->
Obj.repr tag
| f ->
let x = Obj.repr (Array.of_list f) in
Obj.set_tag x tag;
x)
let tag = Atoms.get_map v m in
let x = Obj.repr (Array.of_list (get_sequence f)) in
Obj.set_tag x tag;
x
| _ -> assert false
......@@ -150,7 +150,7 @@ cduce/compile/lambda.cmx: array.cmx format.cmx cduce/types/ident.cmx list.cmx \
cduce/runtime/value.cmi: cduce/types/atoms.cmi cduce/types/chars.cmi \
cduce/misc/encodings.cmi format.cmi cduce/types/ident.cmo \
cduce/types/intervals.cmi cduce/compile/lambda.cmi cduce/misc/ns.cmi \
set.cmi cduce/types/types.cmi
obj.cmi set.cmi cduce/types/types.cmi
cduce/runtime/value.cmo: array.cmi cduce/types/atoms.cmi buffer.cmi char.cmi \
cduce/types/chars.cmi cduce/misc/encodings.cmi format.cmi \
cduce/types/ident.cmo cduce/types/intervals.cmi cduce/compile/lambda.cmi \
......@@ -173,15 +173,22 @@ cduce/runtime/run_dispatch.cmx: array.cmx cduce/types/atoms.cmx \
cduce/types/ident.cmx cduce/types/patterns.cmx string.cmx \
cduce/types/types.cmx cduce/runtime/value.cmx \
cduce/runtime/run_dispatch.cmi
cduce/runtime/serial.cmi: cduce/types/ident.cmo cduce/types/patterns.cmi \
cduce/types/types.cmi cduce/runtime/value.cmi
cduce/runtime/serial.cmo: array.cmi cduce/misc/custom.cmo \
cduce/misc/encodings.cmi cduce/types/ident.cmo list.cmi \
cduce/types/patterns.cmi cduce/runtime/run_dispatch.cmi \
cduce/runtime/serial.cmi: cduce/types/atoms.cmi cduce/types/ident.cmo obj.cmi \
cduce/types/patterns.cmi cduce/types/types.cmi cduce/runtime/value.cmi
cduce/runtime/serial.cmo: array.cmi cduce/types/atoms.cmi \
cduce/misc/custom.cmo cduce/misc/encodings.cmi cduce/types/ident.cmo \
list.cmi cduce/types/patterns.cmi cduce/runtime/run_dispatch.cmi \
cduce/misc/serialize.cmi cduce/types/types.cmi cduce/runtime/value.cmi \
cduce/runtime/serial.cmi
cduce/runtime/serial.cmx: array.cmx cduce/misc/custom.cmx \
cduce/misc/encodings.cmx cduce/types/ident.cmx list.cmx \
cduce/types/patterns.cmx cduce/runtime/run_dispatch.cmx \
cduce/runtime/serial.cmx: array.cmx cduce/types/atoms.cmx \
cduce/misc/custom.cmx cduce/misc/encodings.cmx cduce/types/ident.cmx \
list.cmx cduce/types/patterns.cmx cduce/runtime/run_dispatch.cmx \
cduce/misc/serialize.cmx cduce/types/types.cmx cduce/runtime/value.cmx \
cduce/runtime/serial.cmi
cduce/runtime/xml_loader.cmi: cduce/runtime/value.cmi
cduce/runtime/xml_loader.cmo: cduce/types/atoms.cmi list.cmi \
cduce/misc/ns.cmi string.cmi cduce/runtime/value.cmi \
cduce/runtime/xml_loader.cmi
cduce/runtime/xml_loader.cmx: cduce/types/atoms.cmx list.cmx \
cduce/misc/ns.cmx string.cmx cduce/runtime/value.cmx \
cduce/runtime/xml_loader.cmi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment