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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/translate/translate-ty.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/translate/translate-ty.sml

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

revision 3836, Mon May 9 15:30:25 2016 UTC revision 3837, Mon May 9 16:38:09 2016 UTC
# Line 10  Line 10 
10    
11      val tr : SimpleTypes.ty -> HighTypes.ty      val tr : SimpleTypes.ty -> HighTypes.ty
12    
13        val toAPITy : SimpleTypes.ty -> APITypes.t
14    
15    end = struct    end = struct
16    
17      structure Ty = SimpleTypes      structure Ty = SimpleTypes
# Line 32  Line 34 
34              | ty => raise Fail("TranslateTy.tr: unexpected " ^ Ty.toString ty)              | ty => raise Fail("TranslateTy.tr: unexpected " ^ Ty.toString ty)
35            (* end case *))            (* end case *))
36    
37        fun toAPITy ty = (case ty
38               of Ty.T_Bool => APITypes.BoolTy
39                | Ty.T_Int => APITypes.IntTy
40                | Ty.T_String => APITypes.StringTy
41                | Ty.T_Sequence(ty, optDim) => APITypes.SeqTy(toAPITy ty, optDim)
42                | Ty.T_Tensor dd => let
43                    fun cvtDim 1 = NONE
44                      | cvtDim d = SOME d
45                    in
46                      APITypes.TensorTy(List.mapPartial cvtDim dd)
47                    end
48                | Ty.T_Image{dim, shape} => APITypes.ImageTy(dim, shape)
49                | ty => raise Fail("TranslateTy.toAPITy: unexpected " ^ Ty.toString ty)
50              (* end case *))
51    
52    end    end

Legend:
Removed from v.3836  
changed lines
  Added in v.3837

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