Reformatted code to Gobo standard.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
indexing
|
||||
|
||||
description: "JSON Numbers, octal and hexadecimal formats are not used."
|
||||
author: "Javier Velilla"
|
||||
date: "$Date$"
|
||||
@@ -7,54 +8,73 @@ indexing
|
||||
|
||||
class
|
||||
JSON_NUMBER
|
||||
inherit
|
||||
JSON_VALUE
|
||||
rename is_equal as is_equal_json_value
|
||||
end
|
||||
|
||||
inherit
|
||||
|
||||
JSON_VALUE
|
||||
rename
|
||||
is_equal as is_equal_json_value
|
||||
end
|
||||
create
|
||||
|
||||
make_integer,
|
||||
make_real
|
||||
|
||||
feature -- initialization
|
||||
make_integer(argument:INTEGER) is
|
||||
do
|
||||
value:= argument.out
|
||||
internal_hash_code:=argument.hash_code
|
||||
numeric_type:="INTEGER"
|
||||
end
|
||||
|
||||
make_real(argument:REAL) is
|
||||
do
|
||||
value:= argument.out
|
||||
internal_hash_code:=argument.hash_code
|
||||
numeric_type:="REAL"
|
||||
end
|
||||
make_integer (argument: INTEGER) is
|
||||
do
|
||||
item:= argument.out
|
||||
internal_hash_code:=argument.hash_code
|
||||
numeric_type:= "INTEGER"
|
||||
end
|
||||
|
||||
make_real (argument: REAL) is
|
||||
do
|
||||
item:= argument.out
|
||||
internal_hash_code:=argument.hash_code
|
||||
numeric_type:= "REAL"
|
||||
end
|
||||
|
||||
|
||||
feature -- Access
|
||||
to_json:STRING is
|
||||
--
|
||||
do
|
||||
Result:=value
|
||||
end
|
||||
|
||||
hash_code:INTEGER is
|
||||
item: STRING
|
||||
|
||||
hash_code: INTEGER is
|
||||
--
|
||||
do
|
||||
Result:=internal_hash_code
|
||||
end
|
||||
|
||||
|
||||
feature -- Status
|
||||
|
||||
is_equal (other: like Current): BOOLEAN is
|
||||
-- Is `other' attached to an object of the same type
|
||||
-- as current object and identical to it?
|
||||
do
|
||||
Result:=value.is_equal(other.to_json)
|
||||
Result:=item.is_equal (other.to_json)
|
||||
end
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
to_json: STRING is
|
||||
--
|
||||
do
|
||||
Result := item
|
||||
end
|
||||
|
||||
|
||||
feature -- Implementation
|
||||
value:STRING
|
||||
internal_hash_code:INTEGER
|
||||
numeric_type:STRING -- REAL or INTEGER
|
||||
|
||||
internal_hash_code: INTEGER
|
||||
|
||||
numeric_type: STRING -- REAL or INTEGER
|
||||
|
||||
|
||||
invariant
|
||||
|
||||
item_not_void: item /= Void
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user