Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/high-to-mid/split.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/high-to-mid/split.sml

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

revision 3189, Thu Apr 2 18:49:21 2015 UTC revision 3193, Mon Apr 27 21:19:16 2015 UTC
# Line 260  Line 260 
260      (* handleAdd:var*ein_exp list *params*index*args-> (var*einap)*code      (* handleAdd:var*ein_exp list *params*index*args-> (var*einap)*code
261      * calls rewriteOps() lift  on ein_exp      * calls rewriteOps() lift  on ein_exp
262      *)      *)
263      fun handleAdd(y,e1,params,index,args,fieldset,flag)=let  fun   handleAdd(y,e1 as [_,_,_,_],params,index,args,fieldset,flag)=let
264    
265          val (e1',params',args',code,fieldset)=  rewriteOps("add",e1,params,index,[],args,fieldset,flag)          val (e1',params',args',code,fieldset)=  rewriteOps("add",e1,params,index,[],args,fieldset,flag)
266    fun pb es=String.concatWith "\n\n\t-*-" (List.map P.printbody es)
267    val _ =print("\n****Inside Add:"^Int.toString(length index)^"\n -"^ pb e1 ^"----- newbies\n-"^ pb e1')
268    
269    val body =E.Add e1'
270    val einapp= rewriteOrig(y,body,params',index,[],args')
271    in
272    (einapp,code,fieldset)
273    end
274        | handleAdd(y,e1,params,index,args,fieldset,flag)=let
275    
276            val (e1',params',args',code,fieldset)=  rewriteOps("add",e1,params,index,[],args,fieldset,flag)
277            fun pb es=String.concatWith "\n-" (List.map P.printbody es)
278    
279    
280          val body =E.Add e1'          val body =E.Add e1'
281          val einapp= rewriteOrig(y,body,params',index,[],args')          val einapp= rewriteOrig(y,body,params',index,[],args')
282          in          in
# Line 367  Line 381 
381          | itercode(e1::newbies,rest,code,cnt)=let          | itercode(e1::newbies,rest,code,cnt)=let
382              val ((einapp3,code3),_) = split(e1,fieldset,numFlag)              val ((einapp3,code3),_) = split(e1,fieldset,numFlag)
383              val (rest4,code4)=itercode(code3,[],[],cnt+1)              val (rest4,code4)=itercode(code3,[],[],cnt+1)
384                  val _ =(String.concat[printEINAPP(e1),"\n\t===>\n",printEINAPP(einapp3),"\nand\n",(String.concatWith",\n\t"(List.map printEINAPP (code4@rest4)))])                  val _ =print(String.concat[printEINAPP(e1),"\n\t===>\n",printEINAPP(einapp3),"\nand\n",(String.concatWith",\n\t"(List.map printEINAPP (code4@rest4)))])
385              in              in
386                  itercode(newbies,rest@[einapp3],code4@( rest4)@code,cnt+2)                  itercode(newbies,rest@[einapp3],code4@( rest4)@code,cnt+2)
387              end              end

Legend:
Removed from v.3189  
changed lines
  Added in v.3193

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