diff options
Diffstat (limited to 'src/pretty_print_common.ml')
| -rw-r--r-- | src/pretty_print_common.ml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pretty_print_common.ml b/src/pretty_print_common.ml index 5cf85002..315772a4 100644 --- a/src/pretty_print_common.ml +++ b/src/pretty_print_common.ml @@ -41,6 +41,7 @@ (**************************************************************************) open Ast +open Big_int open PPrint let pipe = string "|" @@ -67,7 +68,7 @@ let comma_sp = comma ^^ space let colon_sp = spaces colon let doc_var (Kid_aux(Var v,_)) = string v -let doc_int i = string (string_of_int i) +let doc_int i = string (string_of_big_int i) let doc_op symb a b = infix 2 1 symb a b let doc_unop symb a = prefix 2 1 symb a @@ -167,7 +168,7 @@ let doc_typ, doc_atomic_typ, doc_nexp, doc_nexp_constraint = | Typ_app(Id_aux (Id "range", _), [ Typ_arg_aux(Typ_arg_nexp (Nexp_aux(Nexp_constant n, _)), _); Typ_arg_aux(Typ_arg_nexp m, _);]) -> - (squarebars (if n = 0 then nexp m else doc_op colon (doc_int n) (nexp m))) + (squarebars (if eq_big_int n zero_big_int then nexp m else doc_op colon (doc_int n) (nexp m))) | Typ_app(Id_aux (Id "atom", _), [Typ_arg_aux(Typ_arg_nexp n,_)]) -> (squarecolons (nexp n)) | Typ_app(id,args) -> @@ -211,7 +212,7 @@ let doc_typ, doc_atomic_typ, doc_nexp, doc_nexp_constraint = and atomic_nexp_typ ((Nexp_aux(n,_)) as ne) = match n with | Nexp_var v -> doc_var v | Nexp_id i -> braces (doc_id i) - | Nexp_constant i -> if i < 0 then parens(doc_int i) else doc_int i + | Nexp_constant i -> if lt_big_int i zero_big_int then parens(doc_int i) else doc_int i | Nexp_neg _ | Nexp_exp _ | Nexp_times _ | Nexp_sum _ | Nexp_minus _-> group (parens (nexp ne)) |
