diff options
author | Simon Van Casteren <simon.van.casteren@gmail.com> | 2019-12-11 12:31:50 +0100 |
---|---|---|
committer | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-13 11:46:57 +0100 |
commit | a0efdaf11337df1fb1a5478f9a193a2737b2665b (patch) | |
tree | 6e00fe896cf347da2b3a6e702a25a9087dca3ee5 /src/json.sml | |
parent | 96c72b6bd8bbb2e31da5664172c05a1bcfb41b64 (diff) |
Fixed parsing errors and loading of interfaces
Diffstat (limited to 'src/json.sml')
-rw-r--r-- | src/json.sml | 4 |
1 files changed, 3 insertions, 1 deletions
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 ^ "}" |