mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-17 23:09:43 +02:00
Merged revisions 591 via svnmerge from
/trunk git-svn-id: branches/fixes_2_0@678 -
This commit is contained in:
parent
89edaa9d5d
commit
4626d6e9e5
@ -35,6 +35,7 @@ interface
|
||||
implementation
|
||||
|
||||
uses
|
||||
sysutils,
|
||||
cutils,cclasses,
|
||||
globtype,version,tokens,systems,globals,verbose,
|
||||
symbase,symtable,symsym,
|
||||
@ -515,13 +516,25 @@ implementation
|
||||
{ If the compile level > 1 we get a nice "unit expected" error
|
||||
message if we are trying to use a program as unit.}
|
||||
try
|
||||
if (token=_UNIT) or (compile_level>1) then
|
||||
begin
|
||||
current_module.is_unit:=true;
|
||||
proc_unit;
|
||||
end
|
||||
else
|
||||
proc_program(token=_LIBRARY);
|
||||
try
|
||||
if (token=_UNIT) or (compile_level>1) then
|
||||
begin
|
||||
current_module.is_unit:=true;
|
||||
proc_unit;
|
||||
end
|
||||
else
|
||||
proc_program(token=_LIBRARY);
|
||||
except
|
||||
on ECompilerAbort do
|
||||
raise;
|
||||
on Exception do
|
||||
begin
|
||||
{ Increase errorcounter to prevent some
|
||||
checks during cleanup }
|
||||
inc(status.errorcount);
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
{ restore old state }
|
||||
done_module;
|
||||
|
Loading…
Reference in New Issue
Block a user