summaryrefslogtreecommitdiff
path: root/compiler/PrintPure.ml
diff options
context:
space:
mode:
authorSon Ho2023-01-07 16:47:33 +0100
committerSon HO2023-02-03 11:21:46 +0100
commitf8b7206e0d92aa33812047c521a3c2278fdb6327 (patch)
tree2f7a37aa85200f5757d0c9fa9d9bd46ae6c6fcff /compiler/PrintPure.ml
parent9a94302823e07c4e8a50ea4e67c8f61e8827c23c (diff)
Improve the heuristic to find pretty names for the variables in the loops
Diffstat (limited to '')
-rw-r--r--compiler/PrintPure.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/PrintPure.ml b/compiler/PrintPure.ml
index 532271c3..2c8d5081 100644
--- a/compiler/PrintPure.ml
+++ b/compiler/PrintPure.ml
@@ -521,7 +521,7 @@ let rec texpression_to_string (fmt : ast_formatter) (inside : bool)
let meta_s = meta_to_string fmt meta in
let e = texpression_to_string fmt inside indent indent_incr e in
match meta with
- | Assignment _ | Tag _ ->
+ | Assignment _ | SymbolicAssignment _ | Tag _ ->
let e = meta_s ^ "\n" ^ indent ^ e in
if inside then "(" ^ e ^ ")" else e
| MPlace _ -> "(" ^ meta_s ^ " " ^ e ^ ")")
@@ -665,6 +665,10 @@ and meta_to_string (fmt : ast_formatter) (meta : meta) : string =
"@assign(" ^ mplace_to_string fmt lp ^ " := "
^ texpression_to_string fmt false "" "" rv
^ rp ^ ")"
+ | SymbolicAssignment (var_id, rv) ->
+ "@symb_assign(" ^ VarId.to_string var_id ^ " := "
+ ^ texpression_to_string fmt false "" "" rv
+ ^ ")"
| MPlace mp -> "@mplace=" ^ mplace_to_string fmt mp
| Tag msg -> "@tag \"" ^ msg ^ "\""
in