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

SCM Repository

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

Diff of /trunk/src/compiler/simplify/simplify.sml

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

revision 175, Sat Jul 24 16:53:55 2010 UTC revision 179, Tue Jul 27 20:43:23 2010 UTC
# Line 37  Line 37 
37            fun simplifyDecl dcl = (case dcl            fun simplifyDecl dcl = (case dcl
38                   of AST.D_Input(x, NONE) => globals := x :: !globals                   of AST.D_Input(x, NONE) => globals := x :: !globals
39                    | AST.D_Input(x, SOME e) => let                    | AST.D_Input(x, SOME e) => let
40                        val (stms, e') = simplifyExp (e, [])                        val (stms, x') = simplifyExpToVar (e, [])
41                          val t = newTemp Ty.T_String
42                          val stm = S.S_Assign(t, S.E_Lit(Literal.String(Var.nameOf x)))
43                          val ty = Var.monoTypeOf x
44                          val e' = S.E_Apply(BasisVars.input,
45                                  [Ty.TYPE(MetaVar.newFromType ty)], [t, x'], ty)
46                        in                        in
 (* FIXME: note that we should add code to check for the input value overriding the default value *)  
47                          globals := x :: !globals;                          globals := x :: !globals;
48                          globalInit := S.S_Assign(x, e') :: (stms @ !globalInit)                          globalInit := S.S_Assign(x, e') :: stm :: (stms @ !globalInit)
49                        end                        end
50                    | AST.D_Var(AST.VD_Decl(x, e)) => let                    | AST.D_Var(AST.VD_Decl(x, e)) => let
51                        val (stms, e') = simplifyExp (e, [])                        val (stms, e') = simplifyExp (e, [])

Legend:
Removed from v.175  
changed lines
  Added in v.179

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