Allow detached values
This commit is contained in:
@@ -16,114 +16,133 @@ create
|
|||||||
|
|
||||||
feature
|
feature
|
||||||
|
|
||||||
put_string (value: READABLE_STRING_GENERAL; key: JSON_STRING)
|
put_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING)
|
||||||
-- Assuming there is no item of key `key',
|
-- Assuming there is no item of key `key',
|
||||||
-- insert `value' with `key'.
|
-- insert `value' with `key'.
|
||||||
require
|
require
|
||||||
key_not_present: not has_key (key)
|
key_not_present: not has_key (key)
|
||||||
local
|
local
|
||||||
l_value: JSON_STRING
|
l_value: detachable JSON_STRING
|
||||||
do
|
do
|
||||||
|
if attached value as a_value then
|
||||||
|
create l_value.make_json_from_string_32 (a_value.as_string_32)
|
||||||
|
end
|
||||||
|
put (l_value, key)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_integer (value: detachable INTEGER_64; key: JSON_STRING)
|
||||||
|
-- Assuming there is no item of key `key',
|
||||||
|
-- insert `value' with `key'.
|
||||||
|
require
|
||||||
|
key_not_present: not has_key (key)
|
||||||
|
local
|
||||||
|
l_value: detachable JSON_NUMBER
|
||||||
|
do
|
||||||
|
if attached value as a_value then
|
||||||
|
create l_value.make_integer (a_value)
|
||||||
|
end
|
||||||
|
put (l_value, key)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_natural (value: detachable NATURAL_64; key: JSON_STRING)
|
||||||
|
-- Assuming there is no item of key `key',
|
||||||
|
-- insert `value' with `key'.
|
||||||
|
require
|
||||||
|
key_not_present: not has_key (key)
|
||||||
|
local
|
||||||
|
l_value: detachable JSON_NUMBER
|
||||||
|
do
|
||||||
|
if attached value as a_value then
|
||||||
|
create l_value.make_natural (a_value)
|
||||||
|
end
|
||||||
|
put (l_value, key)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_real (value: detachable DOUBLE; key: JSON_STRING)
|
||||||
|
-- Assuming there is no item of key `key',
|
||||||
|
-- insert `value' with `key'.
|
||||||
|
require
|
||||||
|
key_not_present: not has_key (key)
|
||||||
|
local
|
||||||
|
l_value: detachable JSON_NUMBER
|
||||||
|
do
|
||||||
|
if attached value as a_value then
|
||||||
|
create l_value.make_real (a_value)
|
||||||
|
end
|
||||||
|
put (l_value, key)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_boolean (value: detachable BOOLEAN; key: JSON_STRING)
|
||||||
|
-- Assuming there is no item of key `key',
|
||||||
|
-- insert `value' with `key'.
|
||||||
|
require
|
||||||
|
key_not_present: not has_key (key)
|
||||||
|
local
|
||||||
|
l_value: detachable JSON_BOOLEAN
|
||||||
|
do
|
||||||
|
if attached value as a_value then
|
||||||
|
create l_value.make_boolean (a_value)
|
||||||
|
end
|
||||||
|
put (l_value, key)
|
||||||
|
end
|
||||||
|
|
||||||
|
replace_with_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING)
|
||||||
|
-- Assuming there is no item of key `key',
|
||||||
|
-- insert `value' with `key'.
|
||||||
|
local
|
||||||
|
l_value: detachable JSON_STRING
|
||||||
|
do
|
||||||
|
if attached value as a_value then
|
||||||
create l_value.make_json_from_string_32 (value.as_string_32)
|
create l_value.make_json_from_string_32 (value.as_string_32)
|
||||||
put (l_value, key)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
put_integer (value: INTEGER_64; key: JSON_STRING)
|
|
||||||
-- Assuming there is no item of key `key',
|
|
||||||
-- insert `value' with `key'.
|
|
||||||
require
|
|
||||||
key_not_present: not has_key (key)
|
|
||||||
local
|
|
||||||
l_value: JSON_NUMBER
|
|
||||||
do
|
|
||||||
create l_value.make_integer (value)
|
|
||||||
put (l_value, key)
|
|
||||||
end
|
|
||||||
|
|
||||||
put_natural (value: NATURAL_64; key: JSON_STRING)
|
|
||||||
-- Assuming there is no item of key `key',
|
|
||||||
-- insert `value' with `key'.
|
|
||||||
require
|
|
||||||
key_not_present: not has_key (key)
|
|
||||||
local
|
|
||||||
l_value: JSON_NUMBER
|
|
||||||
do
|
|
||||||
create l_value.make_natural (value)
|
|
||||||
put (l_value, key)
|
|
||||||
end
|
|
||||||
|
|
||||||
put_real (value: DOUBLE; key: JSON_STRING)
|
|
||||||
-- Assuming there is no item of key `key',
|
|
||||||
-- insert `value' with `key'.
|
|
||||||
require
|
|
||||||
key_not_present: not has_key (key)
|
|
||||||
local
|
|
||||||
l_value: JSON_NUMBER
|
|
||||||
do
|
|
||||||
create l_value.make_real (value)
|
|
||||||
put (l_value, key)
|
|
||||||
end
|
|
||||||
|
|
||||||
put_boolean (value: BOOLEAN; key: JSON_STRING)
|
|
||||||
-- Assuming there is no item of key `key',
|
|
||||||
-- insert `value' with `key'.
|
|
||||||
require
|
|
||||||
key_not_present: not has_key (key)
|
|
||||||
local
|
|
||||||
l_value: JSON_BOOLEAN
|
|
||||||
do
|
|
||||||
create l_value.make_boolean (value)
|
|
||||||
put (l_value, key)
|
|
||||||
end
|
|
||||||
|
|
||||||
replace_with_string (value: READABLE_STRING_GENERAL; key: JSON_STRING)
|
|
||||||
-- Assuming there is no item of key `key',
|
|
||||||
-- insert `value' with `key'.
|
|
||||||
local
|
|
||||||
l_value: JSON_STRING
|
|
||||||
do
|
|
||||||
create l_value.make_json_from_string_32 (value.as_string_32)
|
|
||||||
replace (l_value, key)
|
replace (l_value, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
replace_with_integer (value: INTEGER_64; key: JSON_STRING)
|
replace_with_integer (value: detachable INTEGER_64; key: JSON_STRING)
|
||||||
-- Assuming there is no item of key `key',
|
-- Assuming there is no item of key `key',
|
||||||
-- insert `value' with `key'.
|
-- insert `value' with `key'.
|
||||||
local
|
local
|
||||||
l_value: JSON_NUMBER
|
l_value: detachable JSON_NUMBER
|
||||||
do
|
do
|
||||||
create l_value.make_integer (value)
|
if attached value as a_value then
|
||||||
|
create l_value.make_integer (a_value)
|
||||||
|
end
|
||||||
replace (l_value, key)
|
replace (l_value, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
replace_with_with_natural (value: NATURAL_64; key: JSON_STRING)
|
replace_with_with_natural (value: detachable NATURAL_64; key: JSON_STRING)
|
||||||
-- Assuming there is no item of key `key',
|
-- Assuming there is no item of key `key',
|
||||||
-- insert `value' with `key'.
|
-- insert `value' with `key'.
|
||||||
local
|
local
|
||||||
l_value: JSON_NUMBER
|
l_value: detachable JSON_NUMBER
|
||||||
do
|
do
|
||||||
create l_value.make_natural (value)
|
if attached value as a_value then
|
||||||
|
create l_value.make_natural (a_value)
|
||||||
|
end
|
||||||
replace (l_value, key)
|
replace (l_value, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
replace_with_real (value: DOUBLE; key: JSON_STRING)
|
replace_with_real (value: detachable DOUBLE; key: JSON_STRING)
|
||||||
-- Assuming there is no item of key `key',
|
-- Assuming there is no item of key `key',
|
||||||
-- insert `value' with `key'.
|
-- insert `value' with `key'
|
||||||
local
|
local
|
||||||
l_value: JSON_NUMBER
|
l_value: detachable JSON_NUMBER
|
||||||
do
|
do
|
||||||
create l_value.make_real (value)
|
if attached value as a_value then
|
||||||
|
create l_value.make_real (a_value)
|
||||||
|
end
|
||||||
replace (l_value, key)
|
replace (l_value, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
replace_with_boolean (value: detachable BOOLEAN; key: JSON_STRING)
|
||||||
replace_with_boolean (value: BOOLEAN; key: JSON_STRING)
|
|
||||||
-- Assuming there is no item of key `key',
|
-- Assuming there is no item of key `key',
|
||||||
-- insert `value' with `key'.
|
-- insert `value' with `key'.
|
||||||
local
|
local
|
||||||
l_value: JSON_BOOLEAN
|
l_value: detachable JSON_BOOLEAN
|
||||||
do
|
do
|
||||||
create l_value.make_boolean (value)
|
if attached value as a_value then
|
||||||
|
create l_value.make_boolean (a_value)
|
||||||
|
end
|
||||||
replace (l_value, key)
|
replace (l_value, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user