mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-05 18:17:45 +02:00
pastojs: filer: record values
This commit is contained in:
parent
8c2d82b2f9
commit
5f74ba4305
@ -3959,9 +3959,8 @@ begin
|
||||
SubObj:=TJSONObject.Create;
|
||||
Arr.Add(SubObj);
|
||||
SubObj.Add('Name',RecValue.Name);
|
||||
if (RecValue.ValueExp<>nil) and (RecValue.ValueExp.Name<>'') then
|
||||
RaiseMsg(20180209192240,RecValue.ValueExp);
|
||||
WriteElement(SubObj,RecValue.ValueExp,aContext);
|
||||
WriteExpr(SubObj,Expr,'NameExpr',RecValue.NameExp,aContext);
|
||||
WriteExpr(SubObj,Expr,'ValueExpr',RecValue.ValueExp,aContext);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -8328,7 +8327,6 @@ var
|
||||
i: Integer;
|
||||
Data: TJSONData;
|
||||
SubObj: TJSONObject;
|
||||
SubEl: TPasElement;
|
||||
aName: string;
|
||||
begin
|
||||
ReadPasExpr(Obj,Expr,pekListOfExp,aContext);
|
||||
@ -8341,13 +8339,10 @@ begin
|
||||
if not (Data is TJSONObject) then
|
||||
RaiseMsg(20180210173636,Expr,'['+IntToStr(i)+'] is '+GetObjName(Data));
|
||||
SubObj:=TJSONObject(Data);
|
||||
if ReadString(SubObj,'Name',aName,Expr) then
|
||||
Expr.Fields[i].Name:=aName;
|
||||
SubEl:=ReadNewElement(SubObj,Expr);
|
||||
if not (SubEl is TPasExpr) then
|
||||
RaiseMsg(20180210174041,Expr,'['+IntToStr(i)+'] is '+GetObjName(SubEl));
|
||||
Expr.Fields[i].ValueExp:=TPasExpr(SubEl);
|
||||
ReadElement(SubObj,SubEl,aContext);
|
||||
if not ReadString(SubObj,'Name',aName,Expr) then
|
||||
RaiseMsg(20201204144308,Expr);
|
||||
Expr.Fields[i].NameExp:=ReadExpr(SubObj,Expr,'NameExpr',aContext) as TPrimitiveExpr;
|
||||
Expr.Fields[i].ValueExp:=ReadExpr(SubObj,Expr,'ValueExpr',aContext);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user