Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/pgraph/gen-sml.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/pgraph/gen-sml.sml

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

revision 977, Wed Nov 14 16:53:16 2001 UTC revision 1059, Mon Feb 11 17:05:33 2002 UTC
# Line 19  Line 19 
19                  nativesrc: string -> string,                  nativesrc: string -> string,
20                  importstructs: string list,                  importstructs: string list,
21                  outstream: TextIO.outstream,                  outstream: TextIO.outstream,
22                  exportprefix: string } -> unit                  exportprefix: string,
23                    use_toplocal: bool } -> unit
24  end = struct  end = struct
25    
26      type typ = string      type typ = string
# Line 57  Line 58 
58                nativesrc,                nativesrc,
59                importstructs,                importstructs,
60                outstream = outs,                outstream = outs,
61                exportprefix } = args                exportprefix,
62                  use_toplocal } = args
63    
64            val (xlocal, xin, xend) =
65                if use_toplocal then ("local", "in", "end")
66                else ("(* local *)", "(* in *)", "(* end *)")
67    
68          fun out l = app (fn s => TextIO.output (outs, s)) l          fun out l = app (fn s => TextIO.output (outs, s)) l
69    
# Line 116  Line 122 
122                  copy ()                  copy ()
123              end              end
124          in          in
125              out ["local\n"];              out [xlocal, "\n"];
126              SM.appi genimport e;              SM.appi genimport e;
127              out ["in\n"];              out [xin, "\n"];
128              copyfile src;              copyfile src;
129              genexport (oss, fmt)              genexport (oss, fmt)
130              before out ["end\n"]              before out [xend, "\n"]
131          end          end
132    
133          fun filter (e, ss) = SM.filteri (fn (sy, _) => SS.member (ss, sy)) e          fun filter (e, ss) = SM.filteri (fn (sy, _) => SS.member (ss, sy)) e
# Line 136  Line 142 
142                  ENV m => m                  ENV m => m
143                | _ => raise TypeError ("env", v)                | _ => raise TypeError ("env", v)
144    
145          fun namespace "STR" = "structure"          fun namespace P.SGN = "signature"
146            | namespace "SIG" = "signature"            | namespace P.STR = "structure"
147            | namespace "FCT" = "functor"            | namespace P.FCT = "functor"
           | namespace "FSIG" = "funsig"  
           | namespace ns = raise Fail ("unknown namespace spec: " ^ ns)  
148    
149          fun onedef (P.DEF { lhs, rhs }, dm) = let          fun onedef (P.DEF { lhs, rhs }, dm) = let
150              val get = get dm              val get = get dm

Legend:
Removed from v.977  
changed lines
  Added in v.1059

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