Revision 54d032f5 src/printers.ml
src/printers.ml | ||
---|---|---|
86 | 86 |
and pp_app fmt id e r = |
87 | 87 |
match r with |
88 | 88 |
| None -> pp_call fmt id e |
89 |
| Some (x, l) -> fprintf fmt "%t every %s(%s)" (fun fmt -> pp_call fmt id e) l x
|
|
89 |
| Some c -> fprintf fmt "%t every (%a)" (fun fmt -> pp_call fmt id e) pp_expr c
|
|
90 | 90 |
|
91 | 91 |
and pp_call fmt id e = |
92 | 92 |
match id, e.expr_desc with |
... | ... | |
135 | 135 |
Format.fprintf fmt "%s" (if restart then "restart" else "resume") |
136 | 136 |
|
137 | 137 |
let pp_unless fmt (_, expr, restart, st) = |
138 |
Format.fprintf fmt "unless %a %a %s" |
|
138 |
Format.fprintf fmt "unless %a %a %s@ "
|
|
139 | 139 |
pp_expr expr |
140 | 140 |
pp_restart restart |
141 | 141 |
st |
142 | 142 |
|
143 | 143 |
let pp_until fmt (_, expr, restart, st) = |
144 |
Format.fprintf fmt "until %a %a %s" |
|
144 |
Format.fprintf fmt "until %a %a %s@ "
|
|
145 | 145 |
pp_expr expr |
146 | 146 |
pp_restart restart |
147 | 147 |
st |
148 | 148 |
|
149 | 149 |
let rec pp_handler fmt handler = |
150 |
Format.fprintf fmt "state %s -> %a %a let %a tel %a"
|
|
150 |
Format.fprintf fmt "state %s ->@ @[<v 2> %a%alet@,@[<v 2> %a@]@,tel%a@]"
|
|
151 | 151 |
handler.hand_state |
152 |
(Utils.fprintf_list ~sep:"@ " pp_unless) handler.hand_unless
|
|
152 |
(Utils.fprintf_list ~sep:"@," pp_unless) handler.hand_unless
|
|
153 | 153 |
(fun fmt locals -> |
154 | 154 |
match locals with [] -> () | _ -> |
155 | 155 |
Format.fprintf fmt "@[<v 4>var %a@]@ " |
... | ... | |
158 | 158 |
locals) |
159 | 159 |
handler.hand_locals |
160 | 160 |
pp_node_stmts handler.hand_stmts |
161 |
(Utils.fprintf_list ~sep:"@ " pp_until) handler.hand_until
|
|
161 |
(Utils.fprintf_list ~sep:"@," pp_until) handler.hand_until
|
|
162 | 162 |
|
163 | 163 |
and pp_node_stmt fmt stmt = |
164 | 164 |
match stmt with |
... | ... | |
168 | 168 |
and pp_node_stmts fmt stmts = fprintf_list ~sep:"@ " pp_node_stmt fmt stmts |
169 | 169 |
|
170 | 170 |
and pp_node_aut fmt aut = |
171 |
Format.fprintf fmt "automaton %s %a"
|
|
171 |
Format.fprintf fmt "@[<v 0>automaton %s@,%a@]"
|
|
172 | 172 |
aut.aut_id |
173 | 173 |
(Utils.fprintf_list ~sep:"@ " pp_handler) aut.aut_handlers |
174 | 174 |
|
Also available in: Unified diff