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/cm/smlfile/skel-cvt.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/smlfile/skel-cvt.sml

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

revision 280, Tue May 18 09:05:13 1999 UTC revision 281, Tue May 18 14:57:00 1999 UTC
# Line 12  Line 12 
12      val convert : { tree: GenericVC.Ast.dec,      val convert : { tree: GenericVC.Ast.dec,
13                      err: GenericVC.ErrorMsg.severity ->                      err: GenericVC.ErrorMsg.severity ->
14                           GenericVC.Ast.region -> string -> unit }                           GenericVC.Ast.region -> string -> unit }
15          -> Skeleton.decl          -> { skeleton : Skeleton.decl, complain : unit -> unit }
16  end  end
17    
18  structure SkelCvt :> SKELCVT = struct  structure SkelCvt :> SKELCVT = struct
# Line 390  Line 390 
390              NONE => accum              NONE => accum
391            | SOME ty => c_ty (ty, accum)            | SOME ty => c_ty (ty, accum)
392    
393      fun check_toplevel (ast, err) = let      fun convert { tree, err } = let
394          fun check_topl (StrDec _, _) = ()          (* build a function that will complain (once you call it)
395            | check_topl (AbsDec _, _) = ()           * about any existing restriction violations *)
396            | check_topl (FctDec _, _) = ()          fun newReg reg = let
397            | check_topl (SigDec _, _) = ()              fun sameReg (LocalDec (_, body), k) = sameReg (body, k)
398            | check_topl (FsigDec _, _) = ()                | sameReg (SeqDec l, k) = foldl sameReg k l
399            | check_topl (LocalDec (_, body), reg) = check_topl (body, reg)                | sameReg (OpenDec _, k) =
400            | check_topl (SeqDec arg, reg) =                  (fn () => (k (); err EM.COMPLAIN reg "toplevel open"))
401              app (fn ast => check_topl (ast, reg)) arg                | sameReg (MarkDec (arg, reg), k) = newReg reg (arg, k)
402            | check_topl (OpenDec _, reg) = err EM.COMPLAIN reg "toplevel open"                | sameReg ((StrDec _ | AbsDec _ | FctDec _ | SigDec _ |
403            | check_topl (MarkDec (arg, reg), _) = check_topl (arg, reg)                            FsigDec _), k) = k
404            | check_topl (_, reg) =                | sameReg (_, k) =
405              err EM.WARN reg "definition not tracked by CM"                  (fn () =>
406                     (k (); err EM.WARN reg "definition not tracked by CM"))
407    
408      in      in
409          check_topl (ast, (0, 0))              sameReg
410            end
411        in
412            { complain = newReg (0, 0) (tree, fn () => ()), skeleton = c_dec tree }
413      end      end
   
     fun convert { tree, err } = (check_toplevel (tree, err); c_dec tree)  
   
414  end  end

Legend:
Removed from v.280  
changed lines
  Added in v.281

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