/[svn]/types/types.ml
ViewVC logotype

Diff of /types/types.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 251 by abate, Tue Jul 10 17:18:53 2007 UTC revision 252 by abate, Tue Jul 10 17:19:28 2007 UTC
# Line 1041  Line 1041 
1041    | Char of Chars.v    | Char of Chars.v
1042    | Pair of (t * t)    | Pair of (t * t)
1043    | Xml of (t * t)    | Xml of (t * t)
1044    | Record of (label * t) list    | Record of (bool * (label * t) list)
1045    | Fun of (node * node) list    | Fun of (node * node) list
1046    | Other    | Other
1047    exception FoundSampleRecord of (label * t) list    exception FoundSampleRecord of bool * (label * t) list
1048    
1049  let rec sample_rec memo d =  let rec sample_rec memo d =
1050    if (Assumptions.mem d memo) || (is_empty d) then raise Not_found    if (Assumptions.mem d memo) || (is_empty d) then raise Not_found
# Line 1117  Line 1117 
1117            fields := (List.hd !l, sample_rec memo left.(i))::!fields;            fields := (List.hd !l, sample_rec memo left.(i))::!fields;
1118            l := List.tl !l            l := List.tl !l
1119          done;          done;
1120          raise (FoundSampleRecord (List.rev !fields))          raise (FoundSampleRecord (oleft, List.rev !fields))
1121      | (oright,right)::rights ->      | (oright,right)::rights ->
1122          let next = (oleft && (not oright)) in          let next = (oleft && (not oright)) in
1123          if next then aux rights          if next then aux rights
# Line 1135  Line 1135 
1135    if exists (Array.length left)    if exists (Array.length left)
1136      (fun i -> is_empty left.(i)) then raise Not_found;      (fun i -> is_empty left.(i)) then raise Not_found;
1137    try aux rights; raise Not_found    try aux rights; raise Not_found
1138    with FoundSampleRecord r -> r    with FoundSampleRecord (o,r) -> (o,r)
1139    
1140    
1141    
# Line 1155  Line 1155 
1155      | Char c -> Chars.print_v ppf c      | Char c -> Chars.print_v ppf c
1156      | Pair (x1,x2) -> Format.fprintf ppf "(%a,%a)" print x1 print x2      | Pair (x1,x2) -> Format.fprintf ppf "(%a,%a)" print x1 print x2
1157      | 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
1158      | Record r ->      | Record (o,r) ->
1159          Format.fprintf ppf "{ %a }"          Format.fprintf ppf "{ %a%s }"
1160            (print_sep            (print_sep
1161               (fun ppf (l,x) ->               (fun ppf (l,x) ->
1162                  Format.fprintf ppf "%s = %a"                  Format.fprintf ppf "%s = %a"
# Line 1165  Line 1165 
1165               )               )
1166               " ; "               " ; "
1167            ) r            ) r
1168              (if o then "; ..." else "")
1169      | Fun iface ->      | Fun iface ->
1170          Format.fprintf ppf "(fun ( %a ) x -> ...)"          Format.fprintf ppf "(fun ( %a ) x -> ...)"
1171            (print_sep            (print_sep

Legend:
Removed from v.251  
changed lines
  Added in v.252

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5