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 280, Tue May 18 09:05:13 1999 UTC revision 281, Tue May 18 14:57:00 1999 UTC
# Line 25  Line 25 
25                       structure Lex = CMLex                       structure Lex = CMLex
26                       structure LrParser = LrParser)                       structure LrParser = LrParser)
27    
28        (* The error function must look for the source using the GroupReg
29         * group register because the source must not be hard-wired into it
30         * (via closure creation).  The reason for this is that the error
31         * function will get cached in SmlInfo.info but the source will change
32         * when one re-runs the analysis. *)
33    
34      fun parse' (group, groupstack) = let      fun parse' (group, groupstack) = let
35    
36          val currentDir = AbsPath.dir group          val currentDir = AbsPath.dir group
# Line 36  Line 42 
42              { linewidth = !P.linewidth, flush = P.flush, consumer = P.say }              { linewidth = !P.linewidth, flush = P.flush, consumer = P.say }
43          val source = S.newSource (filename, 1, stream, false, errcons)          val source = S.newSource (filename, 1, stream, false, errcons)
44          val sourceMap = #sourceMap source          val sourceMap = #sourceMap source
45          fun error' region m b = EM.error source region EM.COMPLAIN m b          val _ = GroupReg.register (group, source)
46            fun error' region m b = let
47                val src = GroupReg.lookup group
48            in
49                EM.error src region EM.COMPLAIN m b
50            end
51          fun error region m = error' region m EM.nullErrorBody          fun error region m = error' region m EM.nullErrorBody
52    
53          (* recParse returns a group (not an option)          (* recParse returns a group (not an option)
# Line 160  Line 171 
171          else SOME parseResult          else SOME parseResult
172      end      end
173      handle LrParser.ParseError => NONE      handle LrParser.ParseError => NONE
          | Cycle => NONE  
174    
175      fun parse group = parse' (group, [])      fun parse group = (GroupReg.clear (); parse' (group, []))
176  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