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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/simplify/simplify.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/simplify/simplify.sml

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

revision 2146, Sun Feb 17 03:54:05 2013 UTC revision 2147, Sun Feb 17 17:30:09 2013 UTC
# Line 210  Line 210 
210     *)     *)
211      and simplifyBlock stm = mkBlock (simplifyStmt (stm, []))      and simplifyBlock stm = mkBlock (simplifyStmt (stm, []))
212    
213      (* simplify the statement stm where stms is a reverse-order list of preceeding simplified
214       * statements.  This function returns a reverse-order list of simplified statements.
215       *)
216      and simplifyStmt (stm, stms) = (case stm      and simplifyStmt (stm, stms) = (case stm
217             of AST.S_Block body => let             of AST.S_Block body => let
218  (* FIXME: we should probably prune unreachable code in the typechecker and issue a warning! *)  (* FIXME: we should probably prune unreachable code in the typechecker and issue a warning! *)
219                  fun simplify ([], stms) = stms                  fun simplify ([], stms) = stms
220                    | simplify (stm::r, stms) = if contIsNext stm                    | simplify (stm::r, stms) = if contIsNext stm
221                        then simplify (r, simplifyStmt (stm, stms))                        then simplify (r, simplifyStmt (stm, stms))
222                        else simplify (r, [])  (* prune unreachable statements *)                        else simplifyStmt (stm, stms)  (* prune unreachable statements *)
223                  in                  in
224                    simplify (body, stms)                    simplify (body, stms)
225                  end                  end

Legend:
Removed from v.2146  
changed lines
  Added in v.2147

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