From 5b5bc499a16f9370ca832a3943dbcf5093ba3fd2 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Sat, 28 Sep 2024 22:57:13 -0400 Subject: [PATCH] [ci] make compatible to octave 5.2, fix ci error --- jdict.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jdict.m b/jdict.m index 4087218..b4b2290 100644 --- a/jdict.m +++ b/jdict.m @@ -124,7 +124,7 @@ end if (idx.type == '.' && isnumeric(idx.subs)) val = val(idx.subs); - elseif ((strcmp(idx.type, '()') || idx.type == '.') && ismember(idx.subs, {'tojson', 'fromjson', 'v', 'keys', 'len'}) && i < oplen) + elseif ((strcmp(idx.type, '()') || strcmp(idx.type, '.')) && ischar(idx.subs) && ismember(idx.subs, {'tojson', 'fromjson', 'v', 'keys', 'len'}) && i < oplen) if (strcmp(idx.subs, 'v')) if (iscell(val) && strcmp(idxkey(i + 1).type, '()')) idxkey(i + 1).type = '{}'; @@ -140,6 +140,9 @@ if (i < oplen) val = jdict(val); end + elseif (strcmp(idx.type, '.') && ischar(idx.subs) && strcmp(idx.subs, 'v') && oplen == 1) + i = i + 1; + continue; elseif ((idx.type == '.' && ischar(idx.subs)) || (iscell(idx.subs) && ~isempty(idx.subs{1}))) onekey = idx.subs; if (iscell(onekey))