mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 00:48:10 +02:00
* Enable function references and anonymous functions in Delphi mode
This commit is contained in:
parent
b3d3b65bdf
commit
9f3a50315b
@ -55,7 +55,8 @@ interface
|
||||
m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
|
||||
m_out,m_default_para,m_duplicate_names,m_hintdirective,
|
||||
m_property,m_default_inline,m_except,m_advanced_records,
|
||||
m_array_operators,m_prefixed_attributes,m_underscoreisseparator];
|
||||
m_array_operators,m_prefixed_attributes,m_underscoreisseparator,
|
||||
m_function_references,m_anonymous_functions];
|
||||
delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring];
|
||||
fpcmodeswitches =
|
||||
[m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward,
|
||||
|
29
tests/test/tfuncref52.pp
Normal file
29
tests/test/tfuncref52.pp
Normal file
@ -0,0 +1,29 @@
|
||||
// Test to determine that function references are enabled in mode delphi
|
||||
{$mode delphi}
|
||||
{ $modeswitch functionreferences}
|
||||
{%NORUN}
|
||||
program tfuncref52;
|
||||
|
||||
Type
|
||||
TProc = Reference to Procedure;
|
||||
|
||||
var
|
||||
P : TProc;
|
||||
|
||||
Procedure Testit;
|
||||
|
||||
Procedure SoSo;
|
||||
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
P:=SoSo;
|
||||
P;
|
||||
end;
|
||||
|
||||
begin
|
||||
Testit;
|
||||
end.
|
||||
|
25
tests/test/tfuncref53.pp
Normal file
25
tests/test/tfuncref53.pp
Normal file
@ -0,0 +1,25 @@
|
||||
// Test to determine that anonymus functions are enabled in mode delphi
|
||||
{$mode delphi}
|
||||
{%NORUN}
|
||||
program tfuncref52;
|
||||
|
||||
Type
|
||||
TProc = Reference to Procedure;
|
||||
|
||||
var
|
||||
P : TProc;
|
||||
|
||||
Procedure Testit;
|
||||
|
||||
begin
|
||||
P:=procedure
|
||||
begin
|
||||
|
||||
end;
|
||||
P;
|
||||
end;
|
||||
|
||||
begin
|
||||
Testit;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user