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

SCM Repository

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

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

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

revision 91, Thu May 27 15:16:36 2010 UTC revision 96, Thu May 27 17:57:31 2010 UTC
# Line 14  Line 14 
14    
15      structure PT = ParseTree      structure PT = ParseTree
16      structure Ty = Types      structure Ty = Types
17        structure TU = TypeUtil
18      structure U = Util      structure U = Util
19    
20      exception Error      exception Error
# Line 37  Line 38 
38            fun tok2str (S s) = s            fun tok2str (S s) = s
39              | tok2str (A a) = Atom.toString a              | tok2str (A a) = Atom.toString a
40              | tok2str (V x) = Var.nameOf x              | tok2str (V x) = Var.nameOf x
41              | tok2str (TY ty) = TypeUtil.toString ty              | tok2str (TY ty) = TU.toString ty
42              | tok2str (TYS []) = "()"              | tok2str (TYS []) = "()"
43              | tok2str (TYS[ty]) = TypeUtil.toString ty              | tok2str (TYS[ty]) = TU.toString ty
44              | tok2str (TYS tys) = String.concat[              | tok2str (TYS tys) = String.concat[
45                    "(", String.concatWith " * " (List.map TypeUtil.toString tys), ")"                    "(", String.concatWith " * " (List.map TU.toString tys), ")"
46                  ]                  ]
47            in            in
48              error(cxt, List.map tok2str toks)              error(cxt, List.map tok2str toks)
# Line 214  Line 215 
215              | PT.E_Cons args => let              | PT.E_Cons args => let
216                  val (args, ty::tys) = checkExprList (env, cxt, args)                  val (args, ty::tys) = checkExprList (env, cxt, args)
217                  in                  in
218                    case Util.prune ty                    case TU.pruneHead ty
219                     of Ty.T_Tensor shape => let                     of Ty.T_Tensor shape => let
220                          fun chkTy ty' = U.matchType(ty, ty')                          fun chkTy ty' = U.matchType(ty, ty')
221                          val resTy = Ty.T_Tensor(Ty.shapeExt(shape, Ty.DimConst(List.length args)))                          val resTy = Ty.T_Tensor(Ty.shapeExt(shape, Ty.DimConst(List.length args)))

Legend:
Removed from v.91  
changed lines
  Added in v.96

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