]> gitweb.factorcode.org Git - factor.git/commit
json reader: correctly handle empty objects in objects
authorAlec Berryman <alec@thened.net>
Thu, 24 Dec 2009 23:48:16 +0000 (17:48 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 26 Dec 2009 12:29:12 +0000 (01:29 +1300)
commit1a1487d11c290851b8c35105fd9d0cbf7c790b95
treede525ca96532737668f9fc04e529b575189bdbaf
parent7fa3b71c07ff27e3a28a3567d9c3d0ddcb4157f0
json reader: correctly handle empty objects in objects

Attempting to parse { "foo" : {} } previously resulted in an error.
(close-hash) expected to consolidate an object into the values of the
containing object (in the first line of code).  While there is none in
the case of the empty hash, the structure of the accumulator looked like
it contained an unconsolidated object, so it folded the values into the
keys and got very confused.
basis/json/reader/reader-tests.factor
basis/json/reader/reader.factor