Merge branch 'master' of https://github.com/eiffelhub/json
This commit is contained in:
1
contrib/library/text/parser/json/.gitignore
vendored
Normal file
1
contrib/library/text/parser/json/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.swp
|
||||||
@@ -64,7 +64,11 @@ feature -- Conversion
|
|||||||
until
|
until
|
||||||
c.after
|
c.after
|
||||||
loop
|
loop
|
||||||
|
if attached {JSON_STRING} json.value (c.key) as l_key then
|
||||||
|
js := l_key
|
||||||
|
else
|
||||||
create js.make_json (c.key.out)
|
create js.make_json (c.key.out)
|
||||||
|
end
|
||||||
jv := json.value (c.item)
|
jv := json.value (c.item)
|
||||||
if jv /= Void then
|
if jv /= Void then
|
||||||
Result.put (jv, js)
|
Result.put (jv, js)
|
||||||
|
|||||||
@@ -71,7 +71,11 @@ feature -- Conversion
|
|||||||
until
|
until
|
||||||
c.after
|
c.after
|
||||||
loop
|
loop
|
||||||
|
if attached {JSON_STRING} json.value (c.key) as l_key then
|
||||||
|
js := l_key
|
||||||
|
else
|
||||||
create js.make_json (c.key.out)
|
create js.make_json (c.key.out)
|
||||||
|
end
|
||||||
jv := json.value (c.item)
|
jv := json.value (c.item)
|
||||||
if jv /= Void then
|
if jv /= Void then
|
||||||
Result.put (jv, js)
|
Result.put (jv, js)
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ feature {NONE} -- Implementation (Exceptions)
|
|||||||
do
|
do
|
||||||
Result := exception_prefix + "Failed to convert JSON_VALUE to an Eiffel object: " + a_value.generator
|
Result := exception_prefix + "Failed to convert JSON_VALUE to an Eiffel object: " + a_value.generator
|
||||||
if base_class /= Void then
|
if base_class /= Void then
|
||||||
Result.append (" -> " + base_class)
|
Result.append (" -> {" + base_class + "}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ feature {NONE} -- Implementation (Exceptions)
|
|||||||
do
|
do
|
||||||
Result := exception_prefix + "Failed to convert Eiffel object to a JSON_VALUE"
|
Result := exception_prefix + "Failed to convert Eiffel object to a JSON_VALUE"
|
||||||
if an_object /= Void then
|
if an_object /= Void then
|
||||||
Result := ": " + an_object.generator
|
Result.append (" : {" + an_object.generator + "}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ feature -- Test
|
|||||||
jrep := "%"foo\\bar%""
|
jrep := "%"foo\\bar%""
|
||||||
create parser.make_parser (jrep)
|
create parser.make_parser (jrep)
|
||||||
if attached {JSON_STRING} parser.parse as jstring then
|
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
|
end
|
||||||
|
|
||||||
create js.make_json_from_string_32 ({STRING_32}"%/20320/%/22909/")
|
create js.make_json_from_string_32 ({STRING_32}"%/20320/%/22909/")
|
||||||
|
|||||||
Reference in New Issue
Block a user