From 86efe89e734331d2133092f9a40e40560554d538 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Wed, 13 May 2020 15:18:14 -0400 Subject: [PATCH] flag to prevent embedding ND array size specifier --- loadubjson.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/loadubjson.m b/loadubjson.m index 5efdfd6..d0b9f2e 100644 --- a/loadubjson.m +++ b/loadubjson.m @@ -133,8 +133,13 @@ pos=pos+1; [cc,pos]=next_char(inputstr,pos); if(cc=='[') + if(isfield(varargin{1},'noembedding_') && varargin{1}.noembedding_==1) + error('ND array size specifier does not support embedding'); + end + varargin{1}.noembedding_=1; [dim, pos]=parse_array(inputstr, pos, varargin{:}); count=prod(double(dim)); + varargin{1}.noembedding_=0; else [val,pos]=parse_number(inputstr,pos, varargin{:}); count=double(val);