Project

General

Profile

« Previous | Next » 

Revision 1ed1c8b8

Added by Guillaume DAVY almost 3 years ago

Ada: Corrections of some bugs discovered with lustrec-tests

View differences:

src/backends/Ada/ada_backend_ads.ml
135 135
      let ident = (fst instance) in
136 136
      get_substitution m ident submachine, ident, submachine)
137 137
    m.minstances submachines in
138
  let extract_identifier (subst, _, submachine) =
139
    submachine.mname.node_id^"####"^(String.concat "####" (List.map (function (_, typ) -> (asprintf "%a" pp_type typ)) subst))
140
  in
141
  let identifiers = List.map extract_identifier typed_submachines in
142
  let typed_submachines_identified = List.combine identifiers typed_submachines in
143
  let typed_submachines_identified_set = List.fold_left (fun l x -> if List.mem_assoc (fst x) l then l else x::l) [] typed_submachines_identified in
144
  let submachines_set = List.map (function (_, (_, _, machine)) -> machine) typed_submachines_identified_set in
145
  let typed_submachines_set = snd (List.split typed_submachines_identified_set) in
138 146
  let pp_record fmt =
139 147
    pp_state_record_definition fmt (var_list, typed_submachines) in
140 148
  let typed_submachines_filtered =
141
    List.filter (function (l, _, _) -> l != []) typed_submachines in
149
    List.filter (function (l, _, _) -> l != []) typed_submachines_set in
142 150
  let polymorphic_types = find_all_polymorphic_type m in
143 151
  fprintf fmt "@[<v>%a%t%a%a@,  @[<v>@,%a;@,@,%t;@,@,%a;@,@,private@,@,%a%t%a;@,@]@,%a;@.@]"
144 152
    
145 153
    (* Include all the subinstance*)
146
    (Utils.fprintf_list ~sep:";@," pp_with_machine) submachines
147
    (Utils.pp_final_char_if_non_empty ";@,@," submachines)
154
    (Utils.fprintf_list ~sep:";@," pp_with_machine) submachines_set
155
    (Utils.pp_final_char_if_non_empty ";@,@," submachines_set)
148 156
    
149 157
    pp_generic polymorphic_types
150 158
    

Also available in: Unified diff