Changeset 211 for branches/interpreter2/USource.pas
- Timestamp:
- Apr 22, 2020, 9:00:02 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/USource.pas
r208 r211 34 34 function GetFieldsCount: Integer; virtual; 35 35 public 36 Parent: TSourceNode; 36 37 function GetField(Index: Integer): TField; virtual; 37 38 procedure GetValue(Index: Integer; out Value); virtual; … … 54 55 TSourceNodes = class(TSourceNode) 55 56 private 57 Parent: TSourceNode; 56 58 function GetCount: Integer; 57 59 function GetItem(Index: Integer): TObject; … … 316 318 end; 317 319 320 TLoop = class(TCommand) 321 DoBreak: Boolean; 322 DoContinue: Boolean; 323 end; 324 318 325 { TWhileDo } 319 326 320 TWhileDo = class(T Command)327 TWhileDo = class(TLoop) 321 328 private 322 329 function GetFieldsCount: Integer; override; … … 333 340 { TRepeatUntil } 334 341 335 TRepeatUntil = class(T Command)342 TRepeatUntil = class(TLoop) 336 343 private 337 344 function GetFieldsCount: Integer; override; … … 354 361 { TForToDo } 355 362 356 TForToDo = class(T Command)363 TForToDo = class(TLoop) 357 364 private 358 365 function GetFieldsCount: Integer; override; … … 375 382 function GetFieldsCount: Integer; override; 376 383 public 377 Parent : TBlock;384 ParentBlock: TBlock; 378 385 Variables: TVariables; 379 386 Constants: TConstants; … … 1234 1241 begin 1235 1242 Result := Types.SearchByName(Name); 1236 if not Assigned(Result) and Assigned(Parent ) then1237 Result := Parent .Types.SearchByName(Name);1243 if not Assigned(Result) and Assigned(ParentBlock) then 1244 Result := ParentBlock.Types.SearchByName(Name); 1238 1245 end; 1239 1246 … … 1241 1248 begin 1242 1249 Result := Constants.SearchByName(Name); 1243 if not Assigned(Result) and Assigned(Parent ) then1244 Result := Parent .Constants.SearchByName(Name);1250 if not Assigned(Result) and Assigned(ParentBlock) then 1251 Result := ParentBlock.Constants.SearchByName(Name); 1245 1252 end; 1246 1253 … … 1248 1255 begin 1249 1256 Result := Variables.SearchByName(Name); 1250 if not Assigned(Result) and Assigned(Parent ) then1251 Result := Parent .Variables.SearchByName(Name);1257 if not Assigned(Result) and Assigned(ParentBlock) then 1258 Result := ParentBlock.Variables.SearchByName(Name); 1252 1259 end; 1253 1260 … … 1255 1262 begin 1256 1263 Result := Functions.SearchByName(Name); 1257 if not Assigned(Result) and Assigned(Parent ) then1258 Result := Parent .Functions.SearchByName(Name);1264 if not Assigned(Result) and Assigned(ParentBlock) then 1265 Result := ParentBlock.Functions.SearchByName(Name); 1259 1266 end; 1260 1267
Note:
See TracChangeset
for help on using the changeset viewer.