Project

General

Profile

« Previous | Next » 

Revision 808da3ff

Added by Guillaume DAVY over 5 years ago

Ada: Correct state print for variable assignement

View differences:

src/backends/Ada/ada_backend_common.ml
284 284
let pp_var_name fmt id =
285 285
  fprintf fmt "%a" pp_clean_ada_identifier id.var_id
286 286

  
287
(** Print the complete name of variable state.
287
(** Print the complete name of variable.
288
   @param m the machine to check if it is memory
288 289
   @param fmt the formater to print on
289 290
   @param var the variable
290 291
**)
291
let pp_access_var fmt var =
292
  fprintf fmt "%t.%a" pp_state_name pp_var_name var
292
let pp_access_var m fmt var =
293
  if is_memory m var then
294
    fprintf fmt "%t.%a" pp_state_name pp_var_name var
295
  else
296
    pp_var_name fmt var
293 297

  
294 298
(** Print a variable declaration
295 299
   @param mode input/output mode of the parameter
......
541 545
  let rec pp_value m fmt value =
542 546
    match value.value_desc with
543 547
    | Cst c             -> pp_ada_const fmt c
544
    | Var var      ->
545
        if is_memory m var then
546
          pp_access_var fmt var
547
        else
548
          pp_var_name fmt var
548
    | Var var      -> pp_access_var m fmt var
549 549
    | Fun (f_ident, vl) -> pp_basic_lib_fun (pp_value m) f_ident fmt vl
550 550
    | _                 ->
551 551
      raise (Ada_not_supported

Also available in: Unified diff