Project

General

Profile

« Previous | Next » 

Revision 822f31e1

Added by Teme Kahsai about 8 years ago

updating to onera version 30f766a:2016-12-04

View differences:

src/printers.ml
143 143
(*
144 144
let pp_node_var fmt id = fprintf fmt "%s%s: %a(%a)%a" (if id.var_dec_const then "const " else "") id.var_id print_dec_ty id.var_dec_type.ty_dec_desc Types.print_ty id.var_type Clocks.print_ck_suffix id.var_clock
145 145
*)
146
let pp_node_var ?(print_when=false) fmt id =
146
let pp_node_var fmt id =
147 147
  begin
148
      fprintf fmt "%s%s: %a%t%t" 
149
	(if id.var_dec_const then "const " else "") 
150
	id.var_id
151
	Types.print_node_ty id.var_type
152
	(fun fmt -> match id.var_dec_value with
153
	| None -> () 
154
	| Some v -> fprintf fmt " = %a" pp_expr v
155
	)
156
	(fun fmt -> if print_when || not ( Clocks.is_clocked id.var_clock ) then
157
	    fprintf fmt "%a;"
158
	    Clocks.print_ck_suffix id.var_clock
159
	  else
160
	    fprintf fmt "; -- %a"
161
	      Clocks.print_ck_suffix id.var_clock
162
	)
148
    fprintf fmt "%s%s: %a%a" (if id.var_dec_const then "const " else "") id.var_id Types.print_node_ty id.var_type Clocks.print_ck_suffix id.var_clock;
149
    match id.var_dec_value with
150
    | None -> () 
151
    | Some v -> fprintf fmt " = %a" pp_expr v
163 152
  end 
164 153

  
165
let pp_node_args = fprintf_list ~sep:" " (pp_node_var ~print_when:true)
166
let pp_node_var = pp_node_var ~print_when:false
154
let pp_node_args = fprintf_list ~sep:"; " pp_node_var 
167 155

  
168 156
let pp_node_eq fmt eq = 
169 157
  fprintf fmt "%a = %a;" 
......
193 181
      match locals with [] -> () | _ ->
194 182
	Format.fprintf fmt "@[<v 4>var %a@]@ " 
195 183
	  (Utils.fprintf_list ~sep:"@ " 
196
	     (fun fmt v -> pp_node_var fmt v))
184
	     (fun fmt v -> Format.fprintf fmt "%a;" pp_node_var v))
197 185
	  locals)
198 186
    handler.hand_locals
199 187
    pp_node_stmts handler.hand_stmts
......
286 274
  match locals with [] -> () | _ ->
287 275
    fprintf fmt "@[<v 4>var %a@]@ " 
288 276
      (fprintf_list ~sep:"@ " 
289
	 (fun fmt v -> pp_node_var fmt v))
277
	 (fun fmt v -> fprintf fmt "%a;" pp_node_var v))
290 278
      locals
291 279
  ) nd.node_locals
292 280
  (fun fmt checks ->

Also available in: Unified diff