Changeset 17 for trunk/Compiler/Analyze/UAnalyzerPascal.pas
- Timestamp:
- Nov 8, 2010, 2:14:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Analyze/UAnalyzerPascal.pas
r12 r17 27 27 Expressions: TListExpression; var Func: TFunctionCall): Boolean; 28 28 function ParseUses(SourceCode: TUsedModuleList; AExported: Boolean): Boolean; 29 function ParseUsesItem(SourceCode: TUsedModuleList; AExported: Boolean): Boolean; 29 30 function ParseModule(ProgramCode: TProgram): TModule; override; 30 31 function ParseUnit(var SourceCode: TModuleUnit; ProgramCode: TProgram): Boolean; … … 1256 1257 if NextToken = 'uses' then begin 1257 1258 Expect('uses'); 1259 ParseUsesItem(SourceCode, AExported); 1260 while NextToken = ',' do begin 1261 Expect(','); 1262 ParseUsesItem(SourceCode, AExported); 1263 end; 1264 Expect(';'); 1265 Result := True; 1266 end else Result := False; 1267 end; 1268 1269 function TAnalyzerPascal.ParseUsesItem(SourceCode: TUsedModuleList; 1270 AExported: Boolean): Boolean; 1271 begin 1258 1272 with TUsedModule(SourceCode.Items[SourceCode.Add(TUsedModule.Create)]) do begin 1259 1273 Name := ReadToken; … … 1273 1287 end; 1274 1288 end; 1275 while NextToken = ',' do begin1276 Expect(',');1277 with TUsedModule(SourceCode.Items[SourceCode.Add(TUsedModule.Create)]) do1278 begin1279 Name := ReadToken;1280 if NextToken = 'in' then begin1281 Expect('in');1282 Location := ReadToken;1283 end else Location := Name + '.pas';1284 Module := SourceCode.ParentModule.ParentProgram.Modules.Search(Name);1285 if not Assigned(Module) then begin1286 if not ParseFile(Name) then begin1287 ErrorMessage(SUnitNotFound, [Name], -2);1288 SourceCode.Delete(SourceCode.Count - 1);1289 end;1290 end;1291 end;1292 end;1293 Expect(';');1294 Result := True;1295 end else Result := False;1296 1289 end; 1297 1290
Note:
See TracChangeset
for help on using the changeset viewer.