/[svn]/driver/cduce.ml
ViewVC logotype

Diff of /driver/cduce.ml

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

revision 74 by abate, Tue Jul 10 17:03:32 2007 UTC revision 75 by abate, Tue Jul 10 17:03:57 2007 UTC
# Line 85  Line 85 
85                   (List.map (fun p -> Patterns.Compile.normal                   (List.map (fun p -> Patterns.Compile.normal
86                                (Patterns.descr p)) pl) in                                (Patterns.descr p)) pl) in
87        Patterns.Compile.show ppf (Types.descr t) pl        Patterns.Compile.show ppf (Types.descr t) pl
88    | _ -> Format.fprintf ppf "Unknown or ill-formed debugging directive !! @\n"    | `Normal_record t ->
89          Format.fprintf ppf "[DEBUG:normal_record]@\n";
90          let t = Types.descr (Typer.typ t) in
91          let count = ref 0 and seen = ref [] in
92          match Types.Record.first_label t with
93                | `Empty -> Format.fprintf ppf "Empty"
94                | `Any -> Format.fprintf ppf "Any"
95                | `Label l ->
96                    let (pr,ab) = Types.Record.normal' t l in
97                    Format.fprintf ppf "Label (%s,@[" (Types.label_name l);
98                    List.iter (fun (d,n) ->
99                                 Format.fprintf ppf "%a => @[%a@];@\n"
100                                 Types.Print.print_descr d
101                                 Types.Print.print_descr n
102                              ) pr;
103                    Format.fprintf ppf "@] Absent: @[%a@])@\n"
104                      Types.Print.print_descr
105                      (match ab with Some x -> x | None -> Types.empty)
106    (*
107      | `Normal_record t ->
108          Format.fprintf ppf "[DEBUG:normal_record]@\n";
109          let t = Types.descr (Typer.typ t) in
110          let r = Types.Record.normal t in
111          let count = ref 0 and seen = ref [] in
112          let rec aux ppf x =
113            try
114              let no = List.assq x !seen in
115              Format.fprintf ppf "[[%i]]" no
116            with Not_found ->
117              incr count;
118              seen := (x, !count) :: !seen;
119              Format.fprintf ppf "[[%i]]:" !count;
120              match x with
121                | `Success -> Format.fprintf ppf "Success"
122                | `Fail -> Format.fprintf ppf "Fail"
123                | `Label (l,pr,ab) ->
124                    Format.fprintf ppf "Label (%s,@[" (Types.label_name l);
125                    List.iter (fun (d,n) ->
126                                 Format.fprintf ppf "%a => @[%a@];@\n"
127                                 Types.Print.print_descr d
128                                 aux n
129                              ) pr;
130                    Format.fprintf ppf "@] Absent: @[%a@])" aux ab
131          in
132          Format.fprintf ppf "%a@\n" aux r
133    *)
134    
135  let typing_env = ref Typer.Env.empty  let typing_env = ref Typer.Env.empty
136  let eval_env = ref Eval.Env.empty  let eval_env = ref Eval.Env.empty

Legend:
Removed from v.74  
changed lines
  Added in v.75

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