Refactoring
This commit is contained in:
@@ -34,7 +34,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
Myc.Ast.Types; // Added for TTypes.Unknown
|
||||
Myc.Ast.Types;
|
||||
|
||||
{ TUpvalueAnalyzer }
|
||||
|
||||
|
||||
@@ -993,12 +993,12 @@ var
|
||||
valNode: IAstNode;
|
||||
valType: IStaticType;
|
||||
scalarKind: TScalar.TKind;
|
||||
allScalar: Boolean; // Added
|
||||
allScalar: Boolean;
|
||||
begin
|
||||
FNextIsTail := False;
|
||||
SetLength(boundFields, Length(Node.Fields));
|
||||
SetLength(scalarDefFields, Length(Node.Fields)); // Renamed
|
||||
allScalar := True; // Added
|
||||
allScalar := True;
|
||||
|
||||
for i := 0 to High(Node.Fields) do
|
||||
begin
|
||||
|
||||
@@ -780,7 +780,7 @@ var
|
||||
paramArray: TJSONArray;
|
||||
i: Integer;
|
||||
begin
|
||||
// Added deserialization for macro definitions.
|
||||
|
||||
name := JsonToIdentifierNode(AObj.GetValue('Name') as TJSONObject);
|
||||
|
||||
paramArray := AObj.GetValue<TJSONArray>('Parameters');
|
||||
|
||||
@@ -143,7 +143,7 @@ begin
|
||||
stSeries: Result := 'Series';
|
||||
stRecord: Result := 'Record';
|
||||
stRecordSeries: Result := 'RecordSeries';
|
||||
stGenericRecord: Result := 'GenericRecord'; // Added
|
||||
stGenericRecord: Result := 'GenericRecord';
|
||||
else
|
||||
Result := 'ErrorType';
|
||||
end;
|
||||
@@ -159,7 +159,7 @@ type
|
||||
function GetElementType: IStaticType; virtual;
|
||||
function GetSignature: IMethodSignature; virtual;
|
||||
function GetDefinition: IScalarRecordDefinition; virtual;
|
||||
function GetGenericDefinition: IGenericRecordDefinition; virtual; // Added
|
||||
function GetGenericDefinition: IGenericRecordDefinition; virtual;
|
||||
function IsEqual(const Other: IStaticType): Boolean; virtual;
|
||||
function ToString: string; override;
|
||||
end;
|
||||
@@ -180,7 +180,6 @@ begin
|
||||
Result := Default(IScalarRecordDefinition);
|
||||
end;
|
||||
|
||||
// Added
|
||||
function TAbstractStaticType.GetGenericDefinition: IGenericRecordDefinition;
|
||||
begin
|
||||
Result := nil;
|
||||
@@ -433,7 +432,6 @@ begin
|
||||
end;
|
||||
|
||||
// ---
|
||||
// Added: Represents stGenericRecord
|
||||
type
|
||||
TGenericRecordType = class(TAbstractStaticType)
|
||||
private
|
||||
@@ -532,7 +530,6 @@ begin
|
||||
Result := TRecordType.Create(stRecordSeries, ADef);
|
||||
end;
|
||||
|
||||
// Added
|
||||
class function TTypes.CreateGenericRecord(const ADef: IGenericRecordDefinition): IStaticType;
|
||||
begin
|
||||
Result := TGenericRecordType.Create(ADef);
|
||||
|
||||
Reference in New Issue
Block a user