mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-19 10:20:57 +02:00
Debugger: JSon expand - allow non-strict json
This commit is contained in:
parent
d85e87e54f
commit
c5e879e4e5
@ -231,13 +231,13 @@ function TWatchValue.GetResultData: TWatchResultData;
|
||||
if l = 0 then
|
||||
exit;
|
||||
|
||||
while (l > 1) and (s[l] in [' ', #9]) do
|
||||
while (l > 1) and (s[l] in [' ', #9, #10, #13]) do
|
||||
dec(l);
|
||||
if not(s[l] in [']', '}']) then
|
||||
exit;
|
||||
|
||||
i := 1;
|
||||
while (i < l) and (s[i] in [' ', #9]) do
|
||||
while (i < l) and (s[i] in [' ', #9, #10, #13]) do
|
||||
inc(i);
|
||||
if not(s[i] in ['[', '{']) then
|
||||
exit;
|
||||
|
@ -5,7 +5,7 @@ unit IdeDebuggerWatchResultJSon;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, IdeDebuggerWatchResult, fpjson, jsonparser;
|
||||
Classes, SysUtils, IdeDebuggerWatchResult, fpjson, jsonparser, jsonscanner;
|
||||
|
||||
type
|
||||
|
||||
@ -49,10 +49,18 @@ implementation
|
||||
{ TWatchResultDataJSonBase }
|
||||
|
||||
function TWatchResultDataJSonBase.JSon: TJSONData;
|
||||
Var
|
||||
P : TJSONParser;
|
||||
begin
|
||||
if FInternalJSon = nil then
|
||||
try
|
||||
FInternalJSon := GetJSON(AsString);
|
||||
//FInternalJSon := GetJSON(AsString);
|
||||
P := TJSONParser.Create(AsString, [joUTF8,joComments,joIgnoreTrailingComma,joBOMCheck{,joIgnoreDuplicates}]);
|
||||
try
|
||||
FInternalJSon := P.Parse;
|
||||
finally
|
||||
P.Free;
|
||||
end;
|
||||
except
|
||||
FInternalJSon := nil;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user