Skip to content

Commit

Permalink
allow JSON string for the name of an identifier for TTextWriter.Regis…
Browse files Browse the repository at this point in the history
…terCustomJSONSerializerFromText()
  • Loading branch information
Arnaud Bouchez committed Oct 9, 2019
1 parent 3d5a0d3 commit b7a3783
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion SynCommons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -43295,8 +43295,12 @@ procedure TJSONRecordTextDefinition.Parse(Props: TJSONCustomParserRTTI;
PropsMax := 0;
while (P<>nil) and (P^<>#0) do begin
// fill Props[]
if not GetNextFieldProp(P,PropsName[PropsMax]) then
if P^='"' then begin // use JSON string to customize the name
if not GetJSONItemAsRawUTF8(P,PropsName[PropsMax]) then
break;
end else // regular object pascal identifier (i.e. 0..9,a..z,A..Z,_)
if not GetNextFieldProp(P,PropsName[PropsMax]) then
break;
case P^ of
',': begin
inc(P);
Expand Down
2 changes: 1 addition & 1 deletion SynopseCommit.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'1.18.5400'
'1.18.5401'

0 comments on commit b7a3783

Please sign in to comment.