Skip to content
Snippets Groups Projects
Commit f16cc57d authored by Qianqian Fang's avatar Qianqian Fang
Browse files

fix #31, throw an error when : array construct is used

parent 956e000b
No related branches found
No related tags found
No related merge requests found
...@@ -215,6 +215,9 @@ function object = parse_array(inStr, esc, varargin) % JSON array is written in r ...@@ -215,6 +215,9 @@ function object = parse_array(inStr, esc, varargin) % JSON array is written in r
if(isoct && regexp(arraystr,'"','once')) if(isoct && regexp(arraystr,'"','once'))
error('Octave eval can produce empty cells for JSON-like input'); error('Octave eval can produce empty cells for JSON-like input');
end end
if(regexp(arraystr,':','once'))
error('One can not use MATLAB-like ":" construct inside a JSON array');
end
object=eval(arraystr); object=eval(arraystr);
pos=endpos; pos=endpos;
catch catch
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment