Reintroduced parse_object as obsolete, to avoid breaking existing code.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
note
|
note
|
||||||
description: "Parse serialized JSON data"
|
description: "Parse serialized JSON data"
|
||||||
author: "$Author$"
|
author: "$Author: jfiat $"
|
||||||
date: "$Date$"
|
date: "$Date: 2014-11-17 11:54:05 +0100 (lun., 17 nov. 2014) $"
|
||||||
revision: "$Revision$"
|
revision: "$Revision: 96099 $"
|
||||||
|
|
||||||
class
|
class
|
||||||
JSON_PARSER
|
JSON_PARSER
|
||||||
@@ -166,6 +166,18 @@ feature -- Obsolete commands
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
parse_object: detachable JSON_OBJECT
|
||||||
|
-- Parse JSON data `representation'
|
||||||
|
-- start ::= object | array
|
||||||
|
obsolete
|
||||||
|
"Use `parse_content' and `parsed_json_value' [nov/2014]."
|
||||||
|
do
|
||||||
|
parse_content
|
||||||
|
if is_parsed and then attached {JSON_OBJECT} parsed_json_value as jo then
|
||||||
|
Result := jo
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
parse: detachable JSON_VALUE
|
parse: detachable JSON_VALUE
|
||||||
-- Next JSON value from current position on `representation'.
|
-- Next JSON value from current position on `representation'.
|
||||||
obsolete
|
obsolete
|
||||||
@@ -197,7 +209,7 @@ feature {NONE} -- Implementation: parsing
|
|||||||
c := actual
|
c := actual
|
||||||
inspect c
|
inspect c
|
||||||
when token_object_open then
|
when token_object_open then
|
||||||
Result := parse_object
|
Result := next_json_object
|
||||||
when token_double_quote then
|
when token_double_quote then
|
||||||
Result := parse_string
|
Result := parse_string
|
||||||
when token_array_open then
|
when token_array_open then
|
||||||
@@ -231,7 +243,7 @@ feature {NONE} -- Implementation: parsing
|
|||||||
is_parsed_implies_result_not_void: not has_error implies Result /= Void
|
is_parsed_implies_result_not_void: not has_error implies Result /= Void
|
||||||
end
|
end
|
||||||
|
|
||||||
parse_object: JSON_OBJECT
|
next_json_object: JSON_OBJECT
|
||||||
-- object
|
-- object
|
||||||
-- {}
|
-- {}
|
||||||
-- {"key" : "value" [,]}
|
-- {"key" : "value" [,]}
|
||||||
|
|||||||
Reference in New Issue
Block a user