66 JSON_PRETTY_STRING_VISITOR
77
88inherit
9+
910 JSON_VISITOR
1011
1112create
12- make ,
13- make_custom
13+ make , make_custom
1414
1515feature -- Initialization
1616
@@ -26,15 +26,14 @@ feature -- Initialization
2626 output := a_output
2727 create indentation .make_empty
2828 indentation_step := " %T"
29-
3029 object_count_inlining := a_object_count_inlining
3130 array_count_inlining := a_array_count_inlining
3231 end
3332
3433feature -- Access
3534
3635 output : STRING_ 32
37- -- JSON representation
36+ -- JSON representation
3837
3938 indentation : like output
4039
@@ -60,6 +59,7 @@ feature -- Access
6059 end
6160
6261 object_count_inlining : INTEGER
62+
6363 array_count_inlining : INTEGER
6464
6565feature -- Visitor Pattern
@@ -82,10 +82,7 @@ feature -- Visitor Pattern
8282 until
8383 l_json_array .off
8484 loop
85- if
86- line_number > l_line or
87- l_multiple_lines
88- then
85+ if line_number > l_line or l_multiple_lines then
8986 new_line
9087 end
9188 value := l_json_array .item
@@ -96,10 +93,7 @@ feature -- Visitor Pattern
9693 end
9794 end
9895 exdent
99- if
100- line_number > l_line or
101- l_json_array .count >= array_count_inlining
102- then
96+ if line_number > l_line or l_json_array .count >= array_count_inlining then
10397 new_line
10498 end
10599 output .append (" ]" )
@@ -140,10 +134,7 @@ feature -- Visitor Pattern
140134 until
141135 l_pairs .off
142136 loop
143- if
144- line_number > l_line or
145- l_multiple_lines
146- then
137+ if line_number > l_line or l_multiple_lines then
147138 new_line
148139 end
149140 l_pairs .key_for_iteration .accept (Current )
@@ -155,16 +146,13 @@ feature -- Visitor Pattern
155146 end
156147 end
157148 exdent
158- if
159- line_number > l_line or
160- l_pairs .count >= object_count_inlining
161- then
149+ if line_number > l_line or l_pairs .count >= object_count_inlining then
162150 new_line
163151 end
164152 output .append (" }" )
165153 end
166154
167- visit_json_string (a_json_string : JSON_STRING )
155+ visit_json_string (a_json_string : JSON_STRING )
168156 -- Visit `a_json_string'.
169157 do
170158 output .append (" %" " )
0 commit comments