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/compiler/Elaborator/print/ppast.sml
ViewVC logotype

Diff of /sml/trunk/compiler/Elaborator/print/ppast.sml

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

revision 3323, Thu May 7 12:17:47 2009 UTC revision 3324, Thu May 7 23:20:21 2009 UTC
# Line 263  Line 263 
263                  break ppstrm {nsp=1,offset=0};                  break ppstrm {nsp=1,offset=0};
264                  pps "end";                  pps "end";
265                 closeBox ())                 closeBox ())
         | ppExp'(SeqExp [expr],_,d) = ppExp'(expr,false,d-1)  
266          | ppExp'(SeqExp exps,_,d) =          | ppExp'(SeqExp exps,_,d) =
267                ppClosedSequence ppstrm                  let fun parenThunk () = ppClosedSequence ppstrm
268                  {front=(C PP.string "("),                  {front=(C PP.string "("),
269                   sep=(fn ppstrm => (PP.string ppstrm ";";                   sep=(fn ppstrm => (PP.string ppstrm ";";
270                                      break ppstrm {nsp=1,offset=0})),                                      break ppstrm {nsp=1,offset=0})),
# Line 273  Line 272 
272                   pr=(fn _ => fn exp => ppExp'(exp,false,d-1)),                   pr=(fn _ => fn exp => ppExp'(exp,false,d-1)),
273                   style=INCONSISTENT}                   style=INCONSISTENT}
274                  exps                  exps
275                        fun subExpCount (MarkExp (expr, _)) = subExpCount expr
276                          | subExpCount (FlatAppExp subexps) = length subexps
277                          | subExpCount _ = 1
278                    in case exps
279                        of [expr] => if (subExpCount expr) < 2
280                                     then ppExp'(expr,false,d-1)
281                                     else parenThunk()
282                         | _ => parenThunk()
283                    end
284          | ppExp' (IntExp i,_,_) = pps (IntInf.toString i)          | ppExp' (IntExp i,_,_) = pps (IntInf.toString i)
285          | ppExp' (WordExp w,_,_) = pps (IntInf.toString w)          | ppExp' (WordExp w,_,_) = pps (IntInf.toString w)
286          | ppExp' (RealExp r,_,_) = pps r          | ppExp' (RealExp r,_,_) = pps r

Legend:
Removed from v.3323  
changed lines
  Added in v.3324

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