Ignore:
Timestamp:
Oct 19, 2010, 1:11:59 PM (14 years ago)
Author:
george
Message:
  • Minor modifications.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Transpascal/Compiler/Analyze/UPascalParser.pas

    r70 r71  
    66
    77uses
    8   Classes, SysUtils, UParser, USourceCode;
     8  Classes, SysUtils, UParser, USourceCode, Dialogs;
    99
    1010type
     
    6161    Parser.ProgramCode := ProgramCode;
    6262    Parser.OnGetSource := OnGetSource;
    63     if Assigned(FOnGetSource) then begin
     63    if Assigned(OnGetSource) then begin
    6464      if FOnGetSource(Name, Parser.SourceCodeText) then begin
    6565        Parser.Init;
     
    948948        Module := SourceCode.ParentModule.ParentProgram.Modules.Search(Name);
    949949        Exported := AExported;
    950       end else ErrorMessage(SUnitNotFound, [Name]);
     950      end else begin
     951        ErrorMessage(SUnitNotFound, [Name]);
     952        SourceCode.Delete(SourceCode.Count - 1);
     953      end;
    951954    end;
    952955  end;
     
    962965      Module := SourceCode.ParentModule.ParentProgram.Modules.Search(Name);
    963966      if not Assigned(Module) then begin
    964         if not ParseFile(Name) then ErrorMessage(SUnitNotFound, [Name]);
     967        if not ParseFile(Name) then begin
     968          ErrorMessage(SUnitNotFound, [Name]);
     969          SourceCode.Delete(SourceCode.Count - 1);
     970        end;
    965971      end;
    966972    end;
Note: See TracChangeset for help on using the changeset viewer.