This commit is contained in:
Jocelyn Fiat
2012-11-15 16:29:02 +01:00
5 changed files with 240 additions and 231 deletions

View File

@@ -0,0 +1 @@
*.swp

View File

@@ -64,7 +64,11 @@ feature -- Conversion
until
c.after
loop
if attached {JSON_STRING} json.value (c.key) as l_key then
js := l_key
else
create js.make_json (c.key.out)
end
jv := json.value (c.item)
if jv /= Void then
Result.put (jv, js)

View File

@@ -71,7 +71,11 @@ feature -- Conversion
until
c.after
loop
if attached {JSON_STRING} json.value (c.key) as l_key then
js := l_key
else
create js.make_json (c.key.out)
end
jv := json.value (c.item)
if jv /= Void then
Result.put (jv, js)

View File

@@ -245,7 +245,7 @@ feature {NONE} -- Implementation (Exceptions)
do
Result := exception_prefix + "Failed to convert JSON_VALUE to an Eiffel object: " + a_value.generator
if base_class /= Void then
Result.append (" -> " + base_class)
Result.append (" -> {" + base_class + "}")
end
end
@@ -254,7 +254,7 @@ feature {NONE} -- Implementation (Exceptions)
do
Result := exception_prefix + "Failed to convert Eiffel object to a JSON_VALUE"
if an_object /= Void then
Result := ": " + an_object.generator
Result.append (" : {" + an_object.generator + "}")
end
end

View File

@@ -632,7 +632,7 @@ feature -- Test
jrep := "%"foo\\bar%""
create parser.make_parser (jrep)
if attached {JSON_STRING} parser.parse as jstring then
assert ("unescaped string %"foo\\bar%" to %"foo\bar%"", jstring.unescaped_string.same_string ("foo\bar"))
assert ("unescaped string %"foo\\bar%" to %"foo\bar%"", jstring.unescaped_string_8.same_string ("foo\bar"))
end
create js.make_json_from_string_32 ({STRING_32}"%/20320/%/22909/")