Skip to content

Commit 0cc0ba0

Browse files
committed
Reintroduced parse_object as obsolete, to avoid breaking existing code.
1 parent 641e114 commit 0cc0ba0

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

library/parser/json_parser.e

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
note
22
description: "Parse serialized JSON data"
3-
author: "$Author$"
4-
date: "$Date$"
5-
revision: "$Revision$"
3+
author: "$Author: jfiat $"
4+
date: "$Date: 2014-11-17 11:54:05 +0100 (lun., 17 nov. 2014) $"
5+
revision: "$Revision: 96099 $"
66

77
class
88
JSON_PARSER
@@ -166,6 +166,18 @@ feature -- Obsolete commands
166166
end
167167
end
168168

169+
parse_object: detachable JSON_OBJECT
170+
-- Parse JSON data `representation'
171+
-- start ::= object | array
172+
obsolete
173+
"Use `parse_content' and `parsed_json_value' [nov/2014]."
174+
do
175+
parse_content
176+
if is_parsed and then attached {JSON_OBJECT} parsed_json_value as jo then
177+
Result := jo
178+
end
179+
end
180+
169181
parse: detachable JSON_VALUE
170182
-- Next JSON value from current position on `representation'.
171183
obsolete
@@ -197,7 +209,7 @@ feature {NONE} -- Implementation: parsing
197209
c := actual
198210
inspect c
199211
when token_object_open then
200-
Result := parse_object
212+
Result := next_json_object
201213
when token_double_quote then
202214
Result := parse_string
203215
when token_array_open then
@@ -231,7 +243,7 @@ feature {NONE} -- Implementation: parsing
231243
is_parsed_implies_result_not_void: not has_error implies Result /= Void
232244
end
233245

234-
parse_object: JSON_OBJECT
246+
next_json_object: JSON_OBJECT
235247
-- object
236248
-- {}
237249
-- {"key" : "value" [,]}

0 commit comments

Comments
 (0)