of NONE => (ErrorMsg.error mark ("variable `"^(Symbol.name a)^"' not declared here") ; raise ErrorMsg.Error)
| SOME t => t)
| A.ConstExp _ => T.Int
+ | A.StringExp _ => T.String
| A.OpExp (A.EQ, [a, b]) =>
(case (typeof (tds, funcs) vars mark a, typeof (tds, funcs) vars mark b)
of (T.Int, T.Int) => T.Int (* You shall pass! *)
raise ErrorMsg.Error )
| SOME ASSIGNED => ())
| varcheck_exp env (A.ConstExp _) mark = ()
+ | varcheck_exp env (A.StringExp _) mark = ()
| varcheck_exp env (A.OpExp (_, l)) mark = List.app (fn znt => varcheck_exp env znt mark) l
| varcheck_exp env (A.FuncCall (f, l)) mark = List.app (fn znt => varcheck_exp env znt mark) l
| varcheck_exp env (A.Marked m) mark = varcheck_exp env (Mark.kane m) (Mark.ext m)
(* XXX does not check big vs. small types *)
fun typecheck_type (tds, funcs) mark T.Int = ()
+ | typecheck_type (tds, funcs) mark T.String = ()
| typecheck_type (tds, funcs) mark T.TNull = ()
| typecheck_type (tds, funcs) mark (T.Pointer t) = typecheck_type (tds, funcs) mark t
| typecheck_type (tds, funcs) mark (T.Array t) = typecheck_type (tds, funcs) mark t