Commit 84485658 authored by Pietro Abate's avatar Pietro Abate
Browse files

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

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