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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/mid-il/check-mid-il.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/mid-il/check-mid-il.sml

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

revision 1685, Sun Jan 22 15:23:36 2012 UTC revision 1689, Wed Jan 25 14:55:43 2012 UTC
# Line 64  Line 64 
64              | Op.Index(ty as Ty.SeqTy(elemTy, _), _) => (elemTy, [ty])              | Op.Index(ty as Ty.SeqTy(elemTy, _), _) => (elemTy, [ty])
65              | Op.Subscript(ty as Ty.TensorTy dd) => (Ty.realTy, ty :: List.map (fn _ => Ty.intTy) dd)              | Op.Subscript(ty as Ty.TensorTy dd) => (Ty.realTy, ty :: List.map (fn _ => Ty.intTy) dd)
66              | Op.Subscript(ty as Ty.SeqTy(elemTy, d)) => (elemTy, [ty, Ty.intTy])              | Op.Subscript(ty as Ty.SeqTy(elemTy, d)) => (elemTy, [ty, Ty.intTy])
67                | Op.MkDynamic(ty, n) => (Ty.DynSeqTy ty, [Ty.SeqTy(ty, n)])
68                | Op.Prepend ty => (Ty.DynSeqTy ty, [ty, Ty.DynSeqTy ty])
69                | Op.Append ty => (Ty.DynSeqTy ty, [Ty.DynSeqTy ty, ty])
70                | Op.Concat ty => (Ty.DynSeqTy ty, [Ty.DynSeqTy ty, Ty.DynSeqTy ty])
71              | Op.Ceiling d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Ceiling d => (Ty.vecTy d, [Ty.vecTy d])
72              | Op.Floor d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Floor d => (Ty.vecTy d, [Ty.vecTy d])
73              | Op.Round d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Round d => (Ty.vecTy d, [Ty.vecTy d])
# Line 96  Line 100 
100            (* end case *))            (* end case *))
101    
102      fun typeOfCons (_, []) = false      fun typeOfCons (_, []) = false
103          | typeOfCons (Ty.SeqTy(ty, n), tys) =
104              List.all (fn ty' => Ty.same(ty, ty')) tys andalso (List.length tys = n)
105        | typeOfCons (expectedTy, tys as ty1::_) =        | typeOfCons (expectedTy, tys as ty1::_) =
106            if List.all (fn ty => Ty.same(ty1, ty)) tys            if List.all (fn ty => Ty.same(ty1, ty)) tys
107              then (case (expectedTy, ty1)              then (case (expectedTy, ty1)

Legend:
Removed from v.1685  
changed lines
  Added in v.1689

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