<commit_before>indexing

	description: "JSON Numbers, octal and hexadecimal formats are not used."
	author: "<NAME>"
	date: "2008/08/24"
	revision: "Revision 0.1"
	license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"

class
	JSON_NUMBER

inherit

	JSON_VALUE
		redefine
			is_equal
		end


create

	make_integer,
	make_real

feature -- initialization

	make_integer (an_argument: INTEGER) is
			-- Initialize  an instance of JSON_NUMBER as INTEGER
		do
			item := an_argument.out
			numeric_type := INTEGER_TYPE
		end

	make_real (an_argument: REAL) is
			-- Initialize an instance of JSON_NUMBER as REAL
		do
			item := an_argument.out
			numeric_type := REAL_TYPE
		end


feature -- Access

	item: STRING
		-- Content

	hash_code: INTEGER is
			--Hash code value
		do
			Result:=item.hash_code
		end

feature -- Visitor pattern

	accept (a_visitor: JSON_VISITOR) is
			-- Accept `a_visitor'.
			-- (Call `visit_json_number' procedure on `a_visitor'.)
		do
			a_visitor.visit_json_number (Current)
		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 := item.is_equal (other.item)
		end



feature -- Implementation

	INTEGER_TYPE: INTEGER is 1
	REAL_TYPE: INTEGER is 2
	numeric_type: INTEGER



invariant

	item_not_void: item /= Void

end<commit_msg>JSON number is a double precision IEEE number, not a single precision.<commit_after>indexing

	description: "JSON Numbers, octal and hexadecimal formats are not used."
	author: "<NAME>"
	date: "2008/08/24"
	revision: "Revision 0.1"
	license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"

class
	JSON_NUMBER

inherit

	JSON_VALUE
		redefine
			is_equal
		end


create

	make_integer,
	make_real

feature -- initialization

	make_integer (an_argument: INTEGER) is
			-- Initialize  an instance of JSON_NUMBER as INTEGER
		do
			item := an_argument.out
			numeric_type := INTEGER_TYPE
		end

	make_real (an_argument: DOUBLE) is
			-- Initialize an instance of JSON_NUMBER as DOUBLE
		do
			item := an_argument.out
			numeric_type := DOUBLE_TYPE
		end


feature -- Access

	item: STRING
		-- Content

	hash_code: INTEGER is
			--Hash code value
		do
			Result:=item.hash_code
		end

feature -- Visitor pattern

	accept (a_visitor: JSON_VISITOR) is
			-- Accept `a_visitor'.
			-- (Call `visit_json_number' procedure on `a_visitor'.)
		do
			a_visitor.visit_json_number (Current)
		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 := item.is_equal (other.item)
		end



feature -- Implementation

	INTEGER_TYPE: INTEGER is 1
	DOUBLE_TYPE: INTEGER is 2

	numeric_type: INTEGER


invariant

	item_not_void: item /= Void

end
{'fraction_non_alphanumeric': 0.08353637312913331, 'fraction_numerical': 0.008353637312913331, 'mean_word_length': 3.295964125560538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7176400', 'n_tokens_mistral': 1123, 'n_tokens_neox': 947, 'n_words': 302}