Project

General

Profile

Revision e8f55c25 src/machine_code_common.ml

View differences:

src/machine_code_common.ml
299 299
let rec value_of_dimension m dim =
300 300
  match dim.Dimension.dim_desc with
301 301
  | Dimension.Dbool b         ->
302
     mk_val (Cst (Const_tag (if b then Corelang.tag_true else Corelang.tag_false))) Type_predef.type_bool
302
     mk_val (Cst (Const_tag (if b then tag_true else tag_false))) Type_predef.type_bool
303 303
  | Dimension.Dint i          ->
304 304
     mk_val (Cst (Const_int i)) Type_predef.type_int
305 305
  | Dimension.Dident v        -> value_of_ident dim.Dimension.dim_loc m v
......
315 315

  
316 316
let rec dimension_of_value value =
317 317
  match value.value_desc with
318
  | Cst (Const_tag t) when t = Corelang.tag_true  -> Dimension.mkdim_bool  Location.dummy_loc true
319
  | Cst (Const_tag t) when t = Corelang.tag_false -> Dimension.mkdim_bool  Location.dummy_loc false
318
  | Cst (Const_tag t) when t = tag_true  -> Dimension.mkdim_bool  Location.dummy_loc true
319
  | Cst (Const_tag t) when t = tag_false -> Dimension.mkdim_bool  Location.dummy_loc false
320 320
  | Cst (Const_int i)                             -> Dimension.mkdim_int   Location.dummy_loc i
321 321
  | Var v                                         -> Dimension.mkdim_ident Location.dummy_loc v.var_id
322 322
  | Fun (f, args)                                 -> Dimension.mkdim_appl  Location.dummy_loc f (List.map dimension_of_value args)

Also available in: Unified diff