mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 16:30:14 +02:00
fcl-pasrc: error if exports section inside inside procedure
This commit is contained in:
parent
0aecf4d89f
commit
2fa60d1af3
@ -3618,7 +3618,10 @@ begin
|
||||
tkConst:
|
||||
SetBlock(declConst);
|
||||
tkexports:
|
||||
SetBlock(declExports);
|
||||
if Declarations is TPasSection then
|
||||
SetBlock(declExports)
|
||||
else
|
||||
ParseExcTokenError(TokenInfos[tkbegin]);
|
||||
tkResourcestring:
|
||||
if Declarations is TPasSection then
|
||||
SetBlock(declResourcestring)
|
||||
|
@ -986,6 +986,7 @@ type
|
||||
Procedure TestLibrary_ExportFunc_NameIntFail;
|
||||
Procedure TestLibrary_ExportFunc_IndexStringFail;
|
||||
Procedure TestLibrary_ExportVar; // ToDo
|
||||
Procedure TestLibrary_ExportLocFuncFail;
|
||||
Procedure TestLibrary_Initialization_Finalization;
|
||||
Procedure TestLibrary_ExportFuncOverloadFail;
|
||||
Procedure TestLibrary_UnitExports;
|
||||
@ -18852,6 +18853,20 @@ begin
|
||||
ParseLibrary;
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestLibrary_ExportLocFuncFail;
|
||||
begin
|
||||
StartLibrary(false);
|
||||
Add([
|
||||
'procedure Run;',
|
||||
'exports',
|
||||
' Run;',
|
||||
'begin',
|
||||
'end;',
|
||||
'begin',
|
||||
'']);
|
||||
CheckParserException('Expected "begin"',nParserExpectTokenError);
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestLibrary_Initialization_Finalization;
|
||||
begin
|
||||
StartLibrary(false);
|
||||
|
Loading…
Reference in New Issue
Block a user