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

SCM Repository

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

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

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

revision 399, Thu Oct 14 20:08:35 2010 UTC revision 400, Thu Oct 14 21:06:49 2010 UTC
# Line 51  Line 51 
51                    TranslateBasis.translate (lhs, f, tyArgs, args')                    TranslateBasis.translate (lhs, f, tyArgs, args')
52                  end                  end
53              | S.E_Cons args => [(lhs, IL.CONS(List.map (lookup env) args))]              | S.E_Cons args => [(lhs, IL.CONS(List.map (lookup env) args))]
54              | S.E_Slice(x, indices, ty) => raise Fail "FIXME: E_Slice"              | S.E_Slice(x, indices, ty) => let
55                    val x = lookup env x
56                    val mask = List.map isSome indices
57                    fun cvt NONE = NONE
58                      | cvt (SOME x) = SOME(lookup env x)
59                    val indices = List.mapPartial cvt indices
60                    in
61                      if List.all (fn b => b) mask
62                        then [(lhs, IL.OP(HighOps.Subscript(IL.Var.ty x), x::indices))]
63                        else [(lhs, IL.OP(HighOps.Slice(IL.Var.ty lhs, mask), x::indices))]
64                    end
65              | S.E_Input(_, name, NONE) => [(lhs, IL.OP(HighOps.Input name, []))]              | S.E_Input(_, name, NONE) => [(lhs, IL.OP(HighOps.Input name, []))]
66              | S.E_Input(_, name, SOME dflt) =>              | S.E_Input(_, name, SOME dflt) =>
67                  [(lhs, IL.OP(HighOps.InputWithDefault name, [lookup env dflt]))]                  [(lhs, IL.OP(HighOps.InputWithDefault name, [lookup env dflt]))]

Legend:
Removed from v.399  
changed lines
  Added in v.400

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