Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/Semant/basics/conrep.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/basics/conrep.sml

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

revision 16, Wed Mar 11 21:00:04 1998 UTC revision 77, Tue Apr 14 05:21:45 1998 UTC
# Line 36  Line 36 
36           | _ => true)           | _ => true)
37    | notconst _ = true    | notconst _ = true
38    
 (*  
  * fun show((sym,_,_)::syms, r::rs) =  
  *      (print(Symbol.name sym); print ":   ";  
  *      PPBasics.ppRep r; print "\n"; show(syms,rs))  
  *   | show _ = (print "\n")  
  *)  
   
39  (* the first argument indicates whether this is a recursive datatypes *)  (* the first argument indicates whether this is a recursive datatypes *)
40  fun infer false ([(_, false, CONty(_,[ty,_]))]) =  fun infer false ([(_, false, CONty(_,[ty,_]))]) =
41        (case (reduce ty)        (case (reduce ty)
# Line 73  Line 66 
66         in decide(0, 0, cons, [])         in decide(0, 0, cons, [])
67        end        end
68    
69  (*** val infer = fn l => let val l' = infer l in show(l,l'); l' end ***)  (** rebind infer for debugging purpose **)
70    local
71        val pps = PrettyPrint.mk_ppstream
72                      {consumer=TextIO.print,
73                       linewidth=80,
74                       flush = fn() => TextIO.flushOut TextIO.stdOut}
75    
76        fun show((sym,_,_)::syms, r::rs) =
77            (print(Symbol.name sym); print ":   ";
78             PPVal.ppRep pps r; print "\n"; show(syms,rs))
79          | show _ = (print "\n")
80    
81        fun dbg flag cons =
82            let val result = infer flag cons
83            in
84                if !Control.CG.etdebugging then
85                    show(cons, #1 result)
86                else ();
87                result
88            end
89    in
90        val infer = dbg
91    end (* local debugging *)
92    
93    
94  end (* local *)  end (* local *)
95    
96  end (* structure ConRep *)  end (* structure ConRep *)
97    
98    

Legend:
Removed from v.16  
changed lines
  Added in v.77

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0