diff --git a/compiler/global/names.ml b/compiler/global/names.ml index 31f76b7..e5d499a 100644 --- a/compiler/global/names.ml +++ b/compiler/global/names.ml @@ -93,8 +93,7 @@ open Format let print_name ff n = let n = if is_infix n - then "(" ^ (n ^ ")") (* do not remove the space around n, since for example - "(*" would create bugs *) + then "(" ^ (n ^ ")") (* printers should have a special case to print '*' infix *) else n in fprintf ff "%s" n diff --git a/compiler/heptagon/hept_printer.ml b/compiler/heptagon/hept_printer.ml index d0a0c66..596e4d0 100644 --- a/compiler/heptagon/hept_printer.ml +++ b/compiler/heptagon/hept_printer.ml @@ -167,6 +167,7 @@ and print_every ff reset = and print_app ff (app, args) = match app.a_op with | Etuple -> print_exp_tuple ff args + (* we need a special case for '*' and '*.' as printing (_*_) is incorrect *) | Efun { name = n } when (n = "*" or n = "*.") -> let a1, a2 = assert_2 args in fprintf ff "@[%a@, %s@, %a@]" print_exp a1 n print_exp a2