Changeset 24 for trunk/Compiler/USourceCode.pas
- Timestamp:
- Nov 10, 2010, 9:42:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/USourceCode.pas
r19 r24 182 182 end; 183 183 184 { TType } 185 184 186 TType = class 185 187 ForwardDeclared: Boolean; … … 191 193 Exported: Boolean; 192 194 Visibility: TTypeVisibility; 195 Parameters: TTypeList; 196 procedure Assign(Source: TType); 197 constructor Create; 198 destructor Destroy; override; 193 199 end; 194 200 … … 468 474 'shr', 'as', 'div', 'mod', 'or', 'xor', '-', '+', '=', '>', '<', '<>', '<=', 469 475 '>=', 'is', 'in', ':='); 476 477 resourcestring 478 SAssignmentError = 'Assignment error'; 470 479 471 480 implementation … … 1071 1080 constructor TTypeClass.Create; 1072 1081 begin 1082 inherited; 1073 1083 Items := TListType.Create; 1074 1084 end; … … 1080 1090 end; 1081 1091 1092 { TType } 1093 1094 procedure TType.Assign(Source: TType); 1095 var 1096 I: Integer; 1097 NewType: TType; 1098 begin 1099 if Assigned(Source) then begin 1100 Name := Source.Name; 1101 Parameters.Clear; 1102 for I := 0 to Source.Parameters.Count - 1 do begin 1103 NewType := TType.Create; 1104 //NewType := TType(Source.Parameters[I].ClassType.Create); 1105 NewType.Assign(Source.Parameters[I]); 1106 Parameters.Add(NewType); 1107 end; 1108 Visibility := Source.Visibility; 1109 Parent := Source.Parent; 1110 Internal := Source.Internal; 1111 ForwardDeclared := Source.ForwardDeclared; 1112 Exported := Source.Exported; 1113 Size := Source.Size; 1114 UsedType := Source.UsedType; 1115 end else raise Exception.Create(SAssignmentError); 1116 end; 1117 1118 constructor TType.Create; 1119 begin 1120 Parameters := TTypeList.Create; 1121 //Parameters.Parent := Parent.Parent; 1122 end; 1123 1124 destructor TType.Destroy; 1125 begin 1126 Parameters.Free; 1127 inherited Destroy; 1128 end; 1129 1082 1130 end. 1083 1131
Note:
See TracChangeset
for help on using the changeset viewer.