mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 05:09:31 +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:
|
tkConst:
|
||||||
SetBlock(declConst);
|
SetBlock(declConst);
|
||||||
tkexports:
|
tkexports:
|
||||||
SetBlock(declExports);
|
if Declarations is TPasSection then
|
||||||
|
SetBlock(declExports)
|
||||||
|
else
|
||||||
|
ParseExcTokenError(TokenInfos[tkbegin]);
|
||||||
tkResourcestring:
|
tkResourcestring:
|
||||||
if Declarations is TPasSection then
|
if Declarations is TPasSection then
|
||||||
SetBlock(declResourcestring)
|
SetBlock(declResourcestring)
|
||||||
|
@ -986,6 +986,7 @@ type
|
|||||||
Procedure TestLibrary_ExportFunc_NameIntFail;
|
Procedure TestLibrary_ExportFunc_NameIntFail;
|
||||||
Procedure TestLibrary_ExportFunc_IndexStringFail;
|
Procedure TestLibrary_ExportFunc_IndexStringFail;
|
||||||
Procedure TestLibrary_ExportVar; // ToDo
|
Procedure TestLibrary_ExportVar; // ToDo
|
||||||
|
Procedure TestLibrary_ExportLocFuncFail;
|
||||||
Procedure TestLibrary_Initialization_Finalization;
|
Procedure TestLibrary_Initialization_Finalization;
|
||||||
Procedure TestLibrary_ExportFuncOverloadFail;
|
Procedure TestLibrary_ExportFuncOverloadFail;
|
||||||
Procedure TestLibrary_UnitExports;
|
Procedure TestLibrary_UnitExports;
|
||||||
@ -18852,6 +18853,20 @@ begin
|
|||||||
ParseLibrary;
|
ParseLibrary;
|
||||||
end;
|
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;
|
procedure TTestResolver.TestLibrary_Initialization_Finalization;
|
||||||
begin
|
begin
|
||||||
StartLibrary(false);
|
StartLibrary(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user