diff options
author | Christian Hesse <mail@eworm.de> | 2023-10-16 23:38:06 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-10-16 23:43:58 +0200 |
commit | 140ec1a3a26af52572e755c126323097e56a4faa (patch) | |
tree | b8848442c2ff1019c27993cb396f9534a1b8a73c | |
parent | fed7f2da46fc02b12d23c0f05111452b8e9935e6 (diff) |
global-functions: $ParseJson: use temporary variables
-rw-r--r-- | global-functions.rsc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 4617a3a..d510ff9 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -715,11 +715,13 @@ } } else={ :local Key ($Input->$I); - :if ($Input->($I + 1) = ":") do={ - :set ($Return->$Key) ($Input->($I + 2)); + :local Val1 ($Input->($I + 1)); + :local Val2 ($Input->($I + 2)); + :if ($Val1 = ":") do={ + :set ($Return->$Key) $Val2; :set Skip 2; } else={ - :set ($Return->$Key) [ :pick ($Input->($I + 1)) 1 [ :len ($Input->($I + 1)) ] ]; + :set ($Return->$Key) [ :pick $Val1 1 [ :len $Val1 ] ]; :set Skip 1; } } |