|
@@ -502,8 +502,6 @@ implementation
|
|
end;
|
|
end;
|
|
pu:=tused_unit(pu.next);
|
|
pu:=tused_unit(pu.next);
|
|
end;
|
|
end;
|
|
-
|
|
|
|
- consume(_SEMICOLON);
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -542,7 +540,10 @@ implementation
|
|
procedure parse_implementation_uses;
|
|
procedure parse_implementation_uses;
|
|
begin
|
|
begin
|
|
if token=_USES then
|
|
if token=_USES then
|
|
- loadunits;
|
|
|
|
|
|
+ begin
|
|
|
|
+ loadunits;
|
|
|
|
+ consume(_SEMICOLON);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -743,6 +744,7 @@ type
|
|
i,j : longint;
|
|
i,j : longint;
|
|
finishstate:pfinishstate;
|
|
finishstate:pfinishstate;
|
|
globalstate:pglobalstate;
|
|
globalstate:pglobalstate;
|
|
|
|
+ consume_semicolon_after_uses:boolean;
|
|
begin
|
|
begin
|
|
result:=true;
|
|
result:=true;
|
|
|
|
|
|
@@ -847,7 +849,10 @@ type
|
|
{ has it been compiled at a higher level ?}
|
|
{ has it been compiled at a higher level ?}
|
|
if current_module.state=ms_compiled then
|
|
if current_module.state=ms_compiled then
|
|
exit;
|
|
exit;
|
|
- end;
|
|
|
|
|
|
+ consume_semicolon_after_uses:=true;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ consume_semicolon_after_uses:=false;
|
|
|
|
|
|
{ move the global symtable from the temporary local to global }
|
|
{ move the global symtable from the temporary local to global }
|
|
current_module.globalsymtable:=current_module.localsymtable;
|
|
current_module.globalsymtable:=current_module.localsymtable;
|
|
@@ -857,6 +862,11 @@ type
|
|
needs to be added implicitly }
|
|
needs to be added implicitly }
|
|
current_module.updatemaps;
|
|
current_module.updatemaps;
|
|
|
|
|
|
|
|
+ { consume the semicolon after maps have been updated else conditional compiling expressions
|
|
|
|
+ might cause internal errors, see tw8611 }
|
|
|
|
+ if consume_semicolon_after_uses then
|
|
|
|
+ consume(_SEMICOLON);
|
|
|
|
+
|
|
{ create whole program optimisation information (may already be
|
|
{ create whole program optimisation information (may already be
|
|
updated in the interface, e.g., in case of classrefdef typed
|
|
updated in the interface, e.g., in case of classrefdef typed
|
|
constants }
|
|
constants }
|
|
@@ -1889,6 +1899,7 @@ type
|
|
force_init_final : boolean;
|
|
force_init_final : boolean;
|
|
resources_used : boolean;
|
|
resources_used : boolean;
|
|
program_name : ansistring;
|
|
program_name : ansistring;
|
|
|
|
+ consume_semicolon_after_uses : boolean;
|
|
begin
|
|
begin
|
|
DLLsource:=islibrary;
|
|
DLLsource:=islibrary;
|
|
Status.IsLibrary:=IsLibrary;
|
|
Status.IsLibrary:=IsLibrary;
|
|
@@ -2004,11 +2015,21 @@ type
|
|
|
|
|
|
{Load the units used by the program we compile.}
|
|
{Load the units used by the program we compile.}
|
|
if token=_USES then
|
|
if token=_USES then
|
|
- loadunits;
|
|
|
|
|
|
+ begin
|
|
|
|
+ loadunits;
|
|
|
|
+ consume_semicolon_after_uses:=true;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ consume_semicolon_after_uses:=false;
|
|
|
|
|
|
{ All units are read, now give them a number }
|
|
{ All units are read, now give them a number }
|
|
current_module.updatemaps;
|
|
current_module.updatemaps;
|
|
|
|
|
|
|
|
+ { consume the semicolon after maps have been updated else conditional compiling expressions
|
|
|
|
+ might cause internal errors, see tw8611 }
|
|
|
|
+ if consume_semicolon_after_uses then
|
|
|
|
+ consume(_SEMICOLON);
|
|
|
|
+
|
|
{Insert the name of the main program into the symbol table.}
|
|
{Insert the name of the main program into the symbol table.}
|
|
if current_module.realmodulename^<>'' then
|
|
if current_module.realmodulename^<>'' then
|
|
tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
|
|
tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
|