Project

General

Profile

Revision d50b0dc0 src/types.ml

View differences:

src/types.ml
41 41
    Unbound_value of ident  
42 42
  | Already_bound of ident
43 43
  | Already_defined of ident
44
  | Undefined_var of (unit IMap.t)
44
  | Undefined_var of ISet.t
45 45
  | Declared_but_undefined of ident
46 46
  | Unbound_type of ident
47 47
  | Not_a_dimension
......
83 83
    fprintf fmt "%a -> %a" print_ty ty1 print_ty ty2
84 84
  | Ttuple tylist ->
85 85
    fprintf fmt "(%a)"
86
      (Utils.fprintf_list ~sep:"*" print_ty) tylist
86
      (Utils.fprintf_list ~sep:" * " print_ty) tylist
87 87
  | Tenum taglist ->
88 88
    fprintf fmt "enum {%a }"
89 89
      (Utils.fprintf_list ~sep:", " pp_print_string) taglist
......
158 158
    fprintf fmt "Expecting %d argument(s) for homomorphic extension, found %d@." ar1 ar2
159 159
  | Type_mismatch id ->
160 160
    fprintf fmt "Definition and declaration of type %s don't agree@." id
161
  | Undefined_var vmap ->
161
  | Undefined_var vset ->
162 162
    fprintf fmt "No definition provided for variable(s): %a@."
163 163
      (Utils.fprintf_list ~sep:"," pp_print_string)
164
      (fst (Utils.list_of_imap vmap))
164
      (ISet.elements vset)
165 165
  | Declared_but_undefined id ->
166 166
     fprintf fmt "%s is declared but not defined@." id
167 167
  | Type_clash (ty1,ty2) ->
......
214 214
 | Tclock ty -> Some ty
215 215
 | _         -> None
216 216

  
217
let unclock_type ty =
218
  let ty = repr ty in
219
  match ty.tdesc with
220
  | Tclock ty' -> ty'
221
  | _          -> ty
222

  
217 223
let rec is_dimension_type ty =
218 224
 match (repr ty).tdesc with
219 225
 | Tint
......
254 260
let array_type_dimension ty =
255 261
  match (dynamic_type ty).tdesc with
256 262
  | Tarray (d, _) -> d
257
  | _             -> assert false
263
  | _             -> (Format.eprintf "internal error: Types.array_type_dimension %a@." print_ty ty; assert false)
258 264

  
259 265
let rec array_type_multi_dimension ty =
260 266
  match (dynamic_type ty).tdesc with
......
264 270
let array_element_type ty =
265 271
  match (dynamic_type ty).tdesc with
266 272
  | Tarray (_, ty') -> ty'
267
  | _               -> assert false
273
  | _               -> (Format.eprintf "internal error: Types.array_element_type %a@." print_ty ty; assert false)
268 274

  
269 275
let rec array_base_type ty =
270 276
  let ty = repr ty in

Also available in: Unified diff