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 179, Tue Jul 27 20:43:23 2010 UTC revision 185, Wed Jul 28 17:11:09 2010 UTC
# Line 35  Line 35 
35            val globalInit = ref []            val globalInit = ref []
36            val actors = ref []            val actors = ref []
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) => let
39                          val t = newTemp Ty.T_String
40                          val stm = S.S_Assign(t, S.E_Lit(Literal.String(Var.nameOf x)))
41                          val ty = Var.monoTypeOf x
42                          val e' = S.E_Apply(BasisVars.input,
43                                  [Ty.TYPE(MetaVar.newFromType ty)], [t], ty)
44                          in
45                            globals := x :: !globals;
46                            globalInit := S.S_Assign(x, e') :: stm :: !globalInit
47                          end
48                    | AST.D_Input(x, SOME e) => let                    | AST.D_Input(x, SOME e) => let
49                        val (stms, x') = simplifyExpToVar (e, [])                        val (stms, x') = simplifyExpToVar (e, [])
50                        val t = newTemp Ty.T_String                        val t = newTemp Ty.T_String
51                        val stm = S.S_Assign(t, S.E_Lit(Literal.String(Var.nameOf x)))                        val stm = S.S_Assign(t, S.E_Lit(Literal.String(Var.nameOf x)))
52                        val ty = Var.monoTypeOf x                        val ty = Var.monoTypeOf x
53                        val e' = S.E_Apply(BasisVars.input,                        val e' = S.E_Apply(BasisVars.optInput,
54                                [Ty.TYPE(MetaVar.newFromType ty)], [t, x'], ty)                                [Ty.TYPE(MetaVar.newFromType ty)], [t, x'], ty)
55                        in                        in
56                          globals := x :: !globals;                          globals := x :: !globals;

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

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