diff options
| author | Alasdair Armstrong | 2018-11-13 18:54:35 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-11-13 21:50:28 +0000 |
| commit | 60bcce4648ed029ca3c19c023f5ca525b43eced4 (patch) | |
| tree | 999353452b0d0bcb14e19a6123f4b4c73478679c /src | |
| parent | 7a0fba122b781a41de080e365c6d360f41117698 (diff) | |
Make pretty printer stricter with brace placement
Also add a special case for shift-left when we are shifting 8 by a two
bit opcode, or 32 by a one bit opcode.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pretty_print_sail.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pretty_print_sail.ml b/src/pretty_print_sail.ml index d71b32b2..93693339 100644 --- a/src/pretty_print_sail.ml +++ b/src/pretty_print_sail.ml @@ -119,7 +119,7 @@ let doc_nc = match nc_aux with | NC_true -> string "true" | NC_false -> string "false" - | NC_equal (n1, n2) -> nc_op "=" n1 n2 + | NC_equal (n1, n2) -> nc_op "==" n1 n2 | NC_not_equal (n1, n2) -> nc_op "!=" n1 n2 | NC_bounded_ge (n1, n2) -> nc_op ">=" n1 n2 | NC_bounded_le (n1, n2) -> nc_op "<=" n1 n2 @@ -318,7 +318,8 @@ let fixities = let rec doc_exp (E_aux (e_aux, _) as exp) = match e_aux with | E_block [] -> string "()" - | E_block exps -> surround 2 0 lbrace (doc_block exps) rbrace + | E_block exps -> + group (lbrace ^^ nest 4 (hardline ^^ doc_block exps) ^^ hardline ^^ rbrace) | E_nondet exps -> assert false (* This is mostly for the -convert option *) | E_app_infix (x, id, y) when Id.compare (mk_id "quot") id == 0 -> |
