From a0efdaf11337df1fb1a5478f9a193a2737b2665b Mon Sep 17 00:00:00 2001 From: Simon Van Casteren Date: Wed, 11 Dec 2019 12:31:50 +0100 Subject: Fixed parsing errors and loading of interfaces --- src/json.sml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/json.sml') diff --git a/src/json.sml b/src/json.sml index cc9ea6ae..656d28ff 100644 --- a/src/json.sml +++ b/src/json.sml @@ -271,7 +271,9 @@ fun print (ast: json): string = s ^ "\"" | Bool b => if b then "true" else "false" - | Int i => Int.toString i + | Int i => if i >= 0 + then (Int.toString i) + else "-" ^ (Int.toString (Int.abs i)) (* default printing uses ~ instead of - *) | Obj l => "{" ^ List.foldl (fn ((k, v), acc) => acc ^ (if acc = "" then "" else ", ") ^ "\"" ^ k ^ "\": " ^ print v ) "" l ^ "}" -- cgit v1.2.3