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/parse/parse.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/parse/parse.sml

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

revision 631, Fri Apr 28 08:30:52 2000 UTC revision 632, Sat Apr 29 15:50:42 2000 UTC
# Line 63  Line 63 
63          let val changed = ref true          let val changed = ref true
64              fun canStay GG.ERRORGROUP = true (* doesn't matter *)              fun canStay GG.ERRORGROUP = true (* doesn't matter *)
65                | canStay (GG.GROUP { sublibs, ... }) = let                | canStay (GG.GROUP { sublibs, ... }) = let
66                    fun goodSublib (p, GG.GROUP { kind = GG.STABLELIB _, ... }) =                      fun goodSublib (p, GG.GROUP {
67                                kind = GG.LIB { kind = GG.STABLE _, ... }, ... }) =
68                        SrcPath.compare (p, igp) = EQUAL orelse                        SrcPath.compare (p, igp) = EQUAL orelse
69                        SrcPathMap.inDomain (!sgc, p)                        SrcPathMap.inDomain (!sgc, p)
70                      | goodSublib _ = true                      | goodSublib _ = true
# Line 83  Line 84 
84      fun listLibs () = map #1 (SrcPathMap.listItemsi (!sgc))      fun listLibs () = map #1 (SrcPathMap.listItemsi (!sgc))
85    
86      fun dropPickles () = let      fun dropPickles () = let
87          fun drop (GG.GROUP { kind = GG.STABLELIB dropper, ... }) = dropper ()          fun drop (GG.GROUP { kind = GG.LIB { kind = GG.STABLE dropper,
88                                                 ... }, ... }) = dropper ()
89            | drop _ = ()            | drop _ = ()
90      in      in
91          SrcPathMap.app drop (!sgc)          SrcPathMap.app drop (!sgc)
# Line 176  Line 178 
178                | [] => false                | [] => false
179          end          end
180    
181          fun mparse (group, groupstack, pErrFlag, stabthis, curlib) = let          fun mparse (group, vers, groupstack, pErrFlag, stabthis, curlib) = let
182              fun getStable stablestack gpath = let              fun getStable stablestack (gpath, vers) = let
183                  (* This is a separate "findCycle" routine that detects                  (* This is a separate "findCycle" routine that detects
184                   * cycles among stable libraries.  These cycles should                   * cycles among stable libraries.  These cycles should
185                   * never occur unless someone purposefully renames                   * never occur unless someone purposefully renames
# Line 207  Line 209 
209                      val go = Stabilize.loadStable ginfo                      val go = Stabilize.loadStable ginfo
210                          { getGroup = getStable (gpath :: stablestack),                          { getGroup = getStable (gpath :: stablestack),
211                            anyerrors = pErrFlag }                            anyerrors = pErrFlag }
212                          gpath                          (gpath, vers)
213                  in                  in
214                      case go of                      case go of
215                          NONE => NONE                          NONE => NONE
# Line 243  Line 245 
245              case SrcPathMap.find (!gc, group) of              case SrcPathMap.find (!gc, group) of
246                  SOME gopt => gopt                  SOME gopt => gopt
247                | NONE => let                | NONE => let
248                      fun try_s () = getStable [] group                      fun try_s () = getStable [] (group, vers)
249                      fun try_n () = parse' (group, groupstack, pErrFlag, curlib)                      fun try_n () = parse' (group, groupstack, pErrFlag, curlib)
250                      fun reg gopt =                      fun reg gopt =
251                          (gc := SrcPathMap.insert (!gc, group, gopt); gopt)                          (gc := SrcPathMap.insert (!gc, group, gopt); gopt)
# Line 306  Line 308 
308                       * This function is used to parse sub-groups.                       * This function is used to parse sub-groups.
309                       * Errors are propagated by explicitly setting the                       * Errors are propagated by explicitly setting the
310                       * "anyErrors" flag of the parent group. *)                       * "anyErrors" flag of the parent group. *)
311                      fun recParse (p1, p2) curlib p = let                      fun recParse (p1, p2) curlib (p, v) = let
312                          val gs' = (group, (source, p1, p2)) :: groupstack                          val gs' = (group, (source, p1, p2)) :: groupstack
313                          (* my error flag *)                          (* my error flag *)
314                          val mef = #anyErrors source                          val mef = #anyErrors source
# Line 315  Line 317 
317                           * recursive traversals once there was an error on                           * recursive traversals once there was an error on
318                           * this group. *)                           * this group. *)
319                          if !mef andalso not keep_going then GG.ERRORGROUP                          if !mef andalso not keep_going then GG.ERRORGROUP
320                          else case mparse (p, gs', mef, staball, curlib) of                          else case mparse (p, v, gs', mef, staball, curlib) of
321                                   NONE => (mef := true; GG.ERRORGROUP)                                   NONE => (mef := true; GG.ERRORGROUP)
322                                 | SOME res => res                                 | SOME res => res
323                      end                      end
# Line 324  Line 326 
326                           GG.ERRORGROUP)                           GG.ERRORGROUP)
327    
328                      fun doMember ({ name, mkpath }, p1, p2, c, oto) =                      fun doMember ({ name, mkpath }, p1, p2, c, oto) =
329                          CMSemant.member (ginfo, recParse (p1, p2), load_plugin)                          CMSemant.member { gp = ginfo,
330                                              rparse = recParse (p1, p2),
331                                              load_plugin = load_plugin }
332                            { name = name, mkpath = mkpath,                            { name = name, mkpath = mkpath,
333                              class = c, tooloptions = oto,                              class = c, tooloptions = oto,
334                              group = (group, (p1, p2)),                              group = (group, (p1, p2)),
# Line 441  Line 445 
445          end          end
446      in      in
447          SmlInfo.newGeneration ();          SmlInfo.newGeneration ();
448          case mparse (group, [], ref false, stabthis, NONE) of          case mparse (group, NONE, [], ref false, stabthis, NONE) of
449              NONE => NONE              NONE => NONE
450            | SOME g => SOME (g, ginfo)            | SOME g => SOME (g, ginfo)
451      end      end

Legend:
Removed from v.631  
changed lines
  Added in v.632

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