Keywords
This commit is contained in:
@@ -24,8 +24,9 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
System.Generics.Collections,
|
||||
Myc.Data.Decimal,
|
||||
System.Generics.Collections;
|
||||
Myc.Data.Keyword;
|
||||
|
||||
{ TRttiAstHelper }
|
||||
|
||||
@@ -35,7 +36,8 @@ var
|
||||
fieldsArray: TJSONArray;
|
||||
i: Integer;
|
||||
fieldObj: TJSONObject;
|
||||
kindStr: string;
|
||||
kindStr, fieldName: string;
|
||||
fieldKey: IKeyword;
|
||||
fields: TArray<TScalarRecordField>;
|
||||
begin
|
||||
jsonValue := TJSONObject.ParseJSONValue(AJson);
|
||||
@@ -55,9 +57,11 @@ begin
|
||||
if not Assigned(fieldObj) then
|
||||
continue;
|
||||
|
||||
fields[i].Name := fieldObj.GetValue<string>('name');
|
||||
fieldName := fieldObj.GetValue<string>('name');
|
||||
fieldKey := TKeywordRegistry.Intern(fieldName);
|
||||
kindStr := fieldObj.GetValue<string>('kind');
|
||||
fields[i].Kind := TScalar.TKind(GetEnumValue(TypeInfo(TScalar.TKind), kindStr));
|
||||
|
||||
fields[i] := TScalarRecordField.Create(fieldKey, TScalar.TKind(GetEnumValue(TypeInfo(TScalar.TKind), kindStr)));
|
||||
end;
|
||||
Result := TScalarRecordDefinition.Create(fields);
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user