There is an Bug in SynHighlighterJSON.pas NumberProc:
// ensure that a zero is followed by a dot
if FLine[Run] = '0' then
if FLine[Run + 1] <> '.' then
begin
FTokenID := tkUnknown;
while (FLine[Run] <> #32) and not IsLineEnd(Run) do Inc(Run);
Exit;
end;
This leads to wrong color for the Attribute in the next line, when the Value is 0, like that:
The red marked values are shown in AttributeAttri colors instead of NumberAttri colors and the next line Attribute is shown in ValueAttri colors instead of AttributeAttri colors. I think the current code is intended to draw decimal numbers below 1 correctly (0.1234) but ignores the possibility that an number value can simply 0.
Patch the code like that will fix the Problem:
// ensure that a zero is followed by a dot
if FLine[Run] = '0' then
if FLine[Run + 1] <> '.' then
begin
if FLine[Run + 1] = ',' then
begin
Inc(Run);
Exit;
end;
FTokenID := tkUnknown;
while (FLine[Run] <> #32) and not IsLineEnd(Run) do Inc(Run);
Exit;
end;
Hello!
There is an Bug in SynHighlighterJSON.pas NumberProc:
This leads to wrong color for the Attribute in the next line, when the Value is 0, like that:
The red marked values are shown in AttributeAttri colors instead of NumberAttri colors and the next line Attribute is shown in ValueAttri colors instead of AttributeAttri colors. I think the current code is intended to draw decimal numbers below 1 correctly (0.1234) but ignores the possibility that an number value can simply 0.
Patch the code like that will fix the Problem: