Skip to content

Commit de28294

Browse files
committed
Merge pull request #9 from Conaclos/working
Apply pretty tool.
2 parents 0db02a8 + 20e7046 commit de28294

33 files changed

+2064
-2042
lines changed

library/extras/file/json_file_reader.e

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ feature -- Access
2626
create template_content.make_empty
2727
l_file.read_stream (l_file.count)
2828
l_last_string := l_file.last_string
29-
check l_last_string /= Void end -- implied by postcondition of `l_file.read_stream'
29+
check
30+
l_last_string /= Void
31+
end -- implied by postcondition of `l_file.read_stream'
3032
template_content.append (l_last_string.string)
3133
Result := template_content
3234
l_file.close

library/extras/visitor/json_iterator.e

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
note
2-
description:
3-
4-
"JSON Iterator"
5-
2+
description: "JSON Iterator"
63
pattern: "Iterator visitor"
74
author: "Jocelyn Fiat"
8-
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
5+
license: "MIT (see http://www.opensource.org/licenses/mit-license.php)"
96
date: "2013/08/01"
107
revision: "Revision 0.1"
118

129
deferred class
1310
JSON_ITERATOR
1411

1512
inherit
13+
1614
JSON_VISITOR
1715

1816
feature -- Visitor Pattern
@@ -52,7 +50,7 @@ feature -- Visitor Pattern
5250
end
5351
end
5452

55-
visit_json_string (a_json_string: JSON_STRING)
53+
visit_json_string (a_json_string: JSON_STRING)
5654
-- Visit `a_json_string'.
5755
do
5856
end

library/extras/visitor/json_pretty_string_visitor.e

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class
66
JSON_PRETTY_STRING_VISITOR
77

88
inherit
9+
910
JSON_VISITOR
1011

1112
create
12-
make,
13-
make_custom
13+
make, make_custom
1414

1515
feature -- 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

3433
feature -- 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

6565
feature -- 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 ("%"")

library/extras/visitor/json_visitor.e

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
note
2-
description:
3-
4-
"JSON Visitor"
5-
2+
description: "JSON Visitor"
63
pattern: "Visitor"
74
author: "Javier Velilla"
8-
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
5+
license: "MIT (see http://www.opensource.org/licenses/mit-license.php)"
96
date: "2008/08/24"
107
revision: "Revision 0.1"
118

@@ -49,7 +46,7 @@ feature -- Visitor Pattern
4946
deferred
5047
end
5148

52-
visit_json_string (a_json_string: JSON_STRING)
49+
visit_json_string (a_json_string: JSON_STRING)
5350
-- Visit `a_json_string'.
5451
require
5552
a_json_string_not_void: a_json_string /= Void

library/extras/visitor/print_json_visitor.e

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ class
88
PRINT_JSON_VISITOR
99

1010
inherit
11+
1112
JSON_VISITOR
1213

13-
create make
14+
create
15+
make
1416

1517
feature -- Initialization
1618

@@ -23,7 +25,7 @@ feature -- Initialization
2325
feature -- Access
2426

2527
to_json: STRING
26-
-- JSON representation
28+
-- JSON representation
2729

2830
feature -- Visitor Pattern
2931

@@ -33,7 +35,7 @@ feature -- Visitor Pattern
3335
value: JSON_VALUE
3436
l_json_array: ARRAYED_LIST [JSON_VALUE]
3537
do
36-
l_json_array:=a_json_array.array_representation
38+
l_json_array := a_json_array.array_representation
3739
to_json.append ("[")
3840
from
3941
l_json_array.start
@@ -44,7 +46,7 @@ feature -- Visitor Pattern
4446
value.accept (Current)
4547
l_json_array.forth
4648
if not l_json_array.after then
47-
to_json.append(",")
49+
to_json.append (",")
4850
end
4951
end
5052
to_json.append ("]")
@@ -71,7 +73,7 @@ feature -- Visitor Pattern
7173
visit_json_object (a_json_object: JSON_OBJECT)
7274
-- Visit `a_json_object'.
7375
local
74-
l_pairs: HASH_TABLE[JSON_VALUE,JSON_STRING]
76+
l_pairs: HASH_TABLE [JSON_VALUE, JSON_STRING]
7577
do
7678
l_pairs := a_json_object.map_representation
7779
to_json.append ("{")
@@ -91,7 +93,7 @@ feature -- Visitor Pattern
9193
to_json.append ("}")
9294
end
9395

94-
visit_json_string (a_json_string: JSON_STRING)
96+
visit_json_string (a_json_string: JSON_STRING)
9597
-- Visit `a_json_string'.
9698
do
9799
to_json.append ("%"")

library/kernel/converters/json_arrayed_list_converter.e

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@ note
55
revision: "$Revision$"
66
file: "$HeadURL: $"
77

8-
class JSON_ARRAYED_LIST_CONVERTER
8+
class
9+
JSON_ARRAYED_LIST_CONVERTER
910

1011
inherit
11-
JSON_LIST_CONVERTER
12+
13+
JSON_LIST_CONVERTER
1214
redefine
1315
object
1416
end
1517

1618
create
17-
make
19+
make
1820

1921
feature -- Access
2022

21-
object: ARRAYED_LIST [detachable ANY]
23+
object: ARRAYED_LIST [detachable ANY]
2224

2325
feature {NONE} -- Factory
2426

library/kernel/converters/json_converter.e

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,34 @@ note
55
revision: "$Revision$"
66
file: "$HeadURL: $"
77

8-
deferred class JSON_CONVERTER
8+
deferred class
9+
JSON_CONVERTER
910

1011
inherit
11-
SHARED_EJSON
12+
13+
SHARED_EJSON
1214

1315
feature -- Access
1416

15-
object: ANY
16-
-- Eiffel object
17-
deferred
18-
end
17+
object: ANY
18+
-- Eiffel object
19+
deferred
20+
end
1921

2022
feature -- Conversion
2123

22-
from_json (j: attached like to_json): detachable like object
23-
-- Convert from JSON value.
24+
from_json (j: attached like to_json): detachable like object
25+
-- Convert from JSON value.
2426
-- Returns Void if unable to convert
25-
deferred
26-
end
27+
deferred
28+
end
2729

28-
to_json (o: like object): detachable JSON_VALUE
29-
-- Convert to JSON value
30-
deferred
31-
end
30+
to_json (o: like object): detachable JSON_VALUE
31+
-- Convert to JSON value
32+
deferred
33+
end
3234

3335
invariant
34-
has_eiffel_object: object /= Void -- An empty object must be created at creation time!
36+
has_eiffel_object: object /= Void -- An empty object must be created at creation time!
3537

3638
end

0 commit comments

Comments
 (0)