Project

General

Profile

Revision 01d48bb0 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
......
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) ->
......
193 193
  | Tstatic (d, _) -> Some d
194 194
  | _              -> None
195 195

  
196
let rec rename_static rename ty =
197
 match (repr ty).tdesc with
198
 | Tstatic (d, ty') -> { ty with tdesc = Tstatic (Dimension.expr_replace_expr rename d, rename_static rename ty') }
199
 | Tarray  (d, ty') -> { ty with tdesc = Tarray  (Dimension.expr_replace_expr rename d, rename_static rename ty') }
200
 | _                -> ty
201
(*Format.eprintf "Types.rename_static %a = %a@." print_ty ty print_ty res; res*)
202

  
203 196
let get_field_type ty label =
204 197
  match (repr ty).tdesc with
205 198
  | Tstruct fl -> (try Some (List.assoc label fl) with Not_found -> None)

Also available in: Unified diff