updated for SML/NJ 110.72
[bpt/mlt.git] / src / mlt.sml
index b853295..2600fa4 100644 (file)
@@ -34,8 +34,8 @@ struct
 
     val errorTy = Types.WILDCARDty
 
-    val ppstream = PrettyPrint.mk_ppstream {consumer = TextIO.print, flush = fn () => TextIO.flushOut TextIO.stdOut,
-                                           linewidth = 80}
+    (*val ppstream = PrettyPrint.mk_ppstream {consumer = TextIO.print, flush = fn () => TextIO.flushOut TextIO.stdOut,
+                                           linewidth = 80}*)
 
     datatype unify =
             ExpUn of exp
@@ -83,6 +83,8 @@ struct
            (case StaticEnv.look (env, Symbol.varSymbol v) of
                 Bindings.CONbind (Types.DATACON {typ, ...}) => #1 (TypesUtil.instantiatePoly typ)
               | _ => raise Fail "Unexpected binding in lookVal")
+
+       
        fun lookCon (env, v, pos) = (lookCon' (env, v))
            handle ModuleUtil.Unbound _ => (error (SOME pos, "Unbound constructor " ^ v);
                               errorTy)
@@ -98,7 +100,7 @@ struct
                                         errorStrct)
 
        fun getStr (STRCT {elements, eenv, ...}, v, pos) = 
-           (case ModuleUtil.getStr (elements, eenv, Symbol.strSymbol v, Access.nullAcc, II.Null) of
+           (case ModuleUtil.getStr (elements, eenv, Symbol.strSymbol v, Access.nullAcc, []) of
                 (Modules.STR {rlzn = {entities, ...}, sign = Modules.SIG {elements, ...}, ...}, _) =>
                 STRCT {elements = elements, eenv = entities}
               | _ => raise Fail "Unexpected spec in getStr")
@@ -129,21 +131,21 @@ struct
                Unify.unifyTy (t1, t2)
            (*end*)
            handle Unify.Unify msg =>
-                  (PrettyPrint.begin_block ppstream PrettyPrint.CONSISTENT 0;
-                   PrettyPrint.add_string ppstream "Error unifying";
-                   PrettyPrint.add_break ppstream (1, 0);
-                   PrettyPrint.begin_block ppstream PrettyPrint.CONSISTENT 5;
+                  ((*PrettyPrint.openBox ppstream (PrettyPrint.Abs 0);
+                   PrettyPrint.string ppstream "Error unifying";
+                   PrettyPrint.newline ppstream;
+                   PrettyPrint.openBox ppstream (PrettyPrint.Abs 5);
                    PPType.ppType env ppstream t1;
-                   PrettyPrint.end_block ppstream;
-                   PrettyPrint.add_break ppstream (1, 0);
-                   PrettyPrint.add_string ppstream "and";
-                   PrettyPrint.add_break ppstream (1, 0);
-                   PrettyPrint.begin_block ppstream PrettyPrint.CONSISTENT 5;
+                   PrettyPrint.closeBox ppstream;
+                   PrettyPrint.newline ppstream;
+                   PrettyPrint.string ppstream "and";
+                   PrettyPrint.newline ppstream;
+                   PrettyPrint.openBox ppstream (PrettyPrint.Abs 5);
                    PPType.ppType env ppstream t2;
-                   PrettyPrint.end_block ppstream;
-                   PrettyPrint.end_block ppstream;
-                   PrettyPrint.add_break ppstream (1, 0);
-                   PrettyPrint.flush_ppstream ppstream;
+                   PrettyPrint.closeBox ppstream;
+                   PrettyPrint.closeBox ppstream;
+                   PrettyPrint.newline ppstream;
+                   PrettyPrint.flushStream ppstream;*)
                    error (SOME pos, Unify.failMessage msg ^ " for " ^ (case e of ExpUn e => Tree.expString e
                                                                                | PatUn p => "<pat>")))
                                      
@@ -182,7 +184,7 @@ struct
                    let
                        val sym = Symbol.strSymbol v
                    in
-                       (case ModuleUtil.getStr (elements, eenv, sym, Access.nullAcc, II.Null) of
+                       (case ModuleUtil.getStr (elements, eenv, sym, Access.nullAcc, []) of
                             (str as Modules.STR {rlzn = {entities, ...}, sign = Modules.SIG {elements, ...}, ...}, _) =>
                             (elements, entities, str)
                           | _ => raise Fail "Unexpected spec in resolveStructure")
@@ -208,7 +210,7 @@ struct
            end
 
        fun tyToString (STATE {env, ...}) ty =
-           PrettyPrint.pp_to_string 65535 (PPType.ppType env) ty
+           PrettyPrintNew.pp_to_string 65535 (PPType.ppType env) ty
 
        fun printFn (state as STATE {config, env, ...}) ty =
            let