Changeset 17 for trunk/Compiler/Analyze


Ignore:
Timestamp:
Nov 8, 2010, 2:14:13 PM (14 years ago)
Author:
george
Message:
  • Modified: Enhanced Delphi producer.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Analyze/UAnalyzerPascal.pas

    r12 r17  
    2727      Expressions: TListExpression; var Func: TFunctionCall): Boolean;
    2828    function ParseUses(SourceCode: TUsedModuleList; AExported: Boolean): Boolean;
     29    function ParseUsesItem(SourceCode: TUsedModuleList; AExported: Boolean): Boolean;
    2930    function ParseModule(ProgramCode: TProgram): TModule; override;
    3031    function ParseUnit(var SourceCode: TModuleUnit; ProgramCode: TProgram): Boolean;
     
    12561257  if NextToken = 'uses' then begin
    12571258    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;
     1267end;
     1268
     1269function TAnalyzerPascal.ParseUsesItem(SourceCode: TUsedModuleList;
     1270  AExported: Boolean): Boolean;
     1271begin
    12581272    with TUsedModule(SourceCode.Items[SourceCode.Add(TUsedModule.Create)]) do begin
    12591273      Name := ReadToken;
     
    12731287      end;
    12741288    end;
    1275     while NextToken = ',' do begin
    1276       Expect(',');
    1277       with TUsedModule(SourceCode.Items[SourceCode.Add(TUsedModule.Create)]) do
    1278       begin
    1279         Name := ReadToken;
    1280         if NextToken = 'in' then begin
    1281           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 begin
    1286           if not ParseFile(Name) then begin
    1287             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;
    12961289end;
    12971290
Note: See TracChangeset for help on using the changeset viewer.