Skip to content

Commit

Permalink
Handle correctly duplicate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kutsurak committed Dec 15, 2023
1 parent a6d4e29 commit 64e3a40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion json/parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@
((eqv? ch #\})
(read-char port)
(cond
(added (uniquify-keys (if ordered (reverse! pairs) pairs) '()))
(added (if ordered
(uniquify-keys pairs '())
(reverse! (uniquify-keys pairs '()))))
(else (json-exception port))))
;; Read one pair and continue.
((eqv? ch #\")
Expand Down

0 comments on commit 64e3a40

Please sign in to comment.