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 398, Thu Oct 14 20:08:18 2010 UTC revision 399, Thu Oct 14 20:08:35 2010 UTC
# Line 232  Line 232 
232                        end                        end
233                  val indices' = List.map checkIndex indices                  val indices' = List.map checkIndex indices
234                  val order = List.length indices'                  val order = List.length indices'
235                    val expectedTy = TU.mkTensorTy order
236                    val resultTy = TU.slice(expectedTy, List.map Option.isSome indices')
237                  in                  in
238                    if U.matchType(ty, TU.mkTensorTy order)                    if U.matchType(ty, expectedTy)
239                      then ()                      then ()
240                      else err (cxt, [                      else err (cxt, [
241                          S "type error in slice operation\n",                          S "type error in slice operation\n",
242                          S "  expected:  ", S(Int.toString order), S "-order tensor\n",                          S "  expected:  ", S(Int.toString order), S "-order tensor\n",
243                          S "  but found: ", TY ty, S "\n"                          S "  but found: ", TY ty, S "\n"
244                        ]);                        ]);
245  (* need to determine the new tensor type by copying dimensions that have ":"                    (AST.E_Slice(e', indices', resultTy), resultTy)
  * indices and removing dimensions that have integer indices.  
  *)  
 (* FIXME *)raise Fail "unimplemented"  
246                  end                  end
247              | PT.E_Tuple args => let              | PT.E_Tuple args => let
248                  val (args, tys) = checkExprList (env, cxt, args)                  val (args, tys) = checkExprList (env, cxt, args)

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

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