Commit 3953a348 authored by Pietro Abate's avatar Pietro Abate

[r2003-03-16 17:39:47 by cvscast] Empty log message

Original author: cvscast
Date: 2003-03-16 17:39:47+00:00
parent d490afd1
......@@ -159,8 +159,8 @@ include depend
driver/examples.ml: cduce tests/web.cd tests/examples.xml
./cduce -quiet tests/web.cd
web/index.html: cduce web/macros.cd web/index.xml
(cd web; ../cduce -quiet macros.cd)
web/index.html: cduce web/site.cd web/site.xml
(cd web; ../cduce -quiet site.cd)
# Site-specific installation
build_web:
......
......@@ -52,6 +52,10 @@ Beppe 2003-01-23
Add libraries inclusion
Alain 2003-03-16
Implemented source file inclusion as a temporary solution
======================================================================
Beppe 2003-01-23
......@@ -64,3 +68,19 @@ Add the following types.
======================================================================
Alain 2003-03-16
Issue a warning for inclusion loops
======================================================================
Alain
2003-03-16
Pretty-printing (or at least decent-printing) of types
Decompilation of regexp
Detection of defined names
======================================================================
......@@ -388,7 +388,10 @@ EXTEND
attrib_spec:
[ [ r = record_spec -> mk loc (Record (true,r))
| "("; t = pat; ")" -> t ] ];
| "("; t = pat; ")" -> t
| "{"; r = record_spec; "}" -> mk loc (Record (true,r))
| "{|"; r = record_spec; "|}" -> mk loc (Record (false,r))
] ];
expr_record_spec:
[ [ r = LIST1
......
......@@ -81,7 +81,7 @@ let import_dtd ppf name filename =
)
in
let elt ppf e =
Format.fprintf ppf "type @[<2>%s =@ @[<3><%s %a>[@ @[%a@]@ ]@]@];;@\n"
Format.fprintf ppf "type @[<2>%s =@ @[<3><%s {|%a|}>[@ @[%a@]@ ]@]@];;@\n"
(name (e # name))
(e # name)
attrib e
......
......@@ -1041,10 +1041,10 @@ type t =
| Char of Chars.v
| Pair of (t * t)
| Xml of (t * t)
| Record of (label * t) list
| Record of (bool * (label * t) list)
| Fun of (node * node) list
| Other
exception FoundSampleRecord of (label * t) list
exception FoundSampleRecord of bool * (label * t) list
let rec sample_rec memo d =
if (Assumptions.mem d memo) || (is_empty d) then raise Not_found
......@@ -1117,7 +1117,7 @@ and sample_rec_record_aux memo (labels,(oleft,left),rights) =
fields := (List.hd !l, sample_rec memo left.(i))::!fields;
l := List.tl !l
done;
raise (FoundSampleRecord (List.rev !fields))
raise (FoundSampleRecord (oleft, List.rev !fields))
| (oright,right)::rights ->
let next = (oleft && (not oright)) in
if next then aux rights
......@@ -1135,7 +1135,7 @@ and sample_rec_record_aux memo (labels,(oleft,left),rights) =
if exists (Array.length left)
(fun i -> is_empty left.(i)) then raise Not_found;
try aux rights; raise Not_found
with FoundSampleRecord r -> r
with FoundSampleRecord (o,r) -> (o,r)
......@@ -1155,8 +1155,8 @@ let get x = try sample_rec Assumptions.empty x with Not_found -> Other
| Char c -> Chars.print_v ppf c
| Pair (x1,x2) -> Format.fprintf ppf "(%a,%a)" print x1 print x2
| Xml (x1,x2) -> Format.fprintf ppf "XML(%a,%a)" print x1 print x2
| Record r ->
Format.fprintf ppf "{ %a }"
| Record (o,r) ->
Format.fprintf ppf "{ %a%s }"
(print_sep
(fun ppf (l,x) ->
Format.fprintf ppf "%s = %a"
......@@ -1165,6 +1165,7 @@ let get x = try sample_rec Assumptions.empty x with Not_found -> Other
)
" ; "
) r
(if o then "; ..." else "")
| Fun iface ->
Format.fprintf ppf "(fun ( %a ) x -> ...)"
(print_sep
......
......@@ -183,15 +183,7 @@ val subtype : descr -> descr -> bool
module Sample :
sig
type t =
| Int of Intervals.v
| Atom of Atoms.v
| Char of Chars.v
| Pair of (t * t)
| Xml of (t * t)
| Record of (label * t) list
| Fun of (node * node) list
| Other
type t
val get : descr -> t
(**
......
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