* disable [...] syntax for procedure directives if modeswitch "prefixed attributes" is enabled; they conflict otherwise and it's not easily resolveable

+ added test

git-svn-id: trunk@42402 -
This commit is contained in:
svenbarth 2019-07-12 22:07:50 +00:00
parent b945e66e28
commit a72553eea2
4 changed files with 38 additions and 2 deletions

2
.gitattributes vendored
View File

@ -13211,6 +13211,8 @@ tests/test/tcustomattr11.pp svneol=native#text/pascal
tests/test/tcustomattr12.pp svneol=native#text/pascal
tests/test/tcustomattr13.pp svneol=native#text/pascal
tests/test/tcustomattr14.pp svneol=native#text/pascal
tests/test/tcustomattr15.pp svneol=native#text/pascal
tests/test/tcustomattr16.pp svneol=native#text/pascal
tests/test/tcustomattr2.pp svneol=native#text/pascal
tests/test/tcustomattr3.pp svneol=native#text/pascal
tests/test/tcustomattr4.pp svneol=native#text/pascal

View File

@ -3277,9 +3277,14 @@ const
else
stoprecording:=false;
while token in [_ID,_LECKKLAMMER] do
while (token=_ID) or
(
not (m_prefixed_attributes in current_settings.modeswitches) and
(token=_LECKKLAMMER)
) do
begin
if try_to_consume(_LECKKLAMMER) then
if not (m_prefixed_attributes in current_settings.modeswitches) and
try_to_consume(_LECKKLAMMER) then
begin
repeat
parse_proc_direc(pd,pdflags);

View File

@ -0,0 +1,14 @@
{ %FAIL }
{ prefixed attributes modeswitch disables procedure directives inside [...] }
program tcustomattr15;
{$mode delphi}
procedure Test; [cdecl];
begin
end;
begin
end.

View File

@ -0,0 +1,15 @@
{ %FAIL }
{ prefixed attributes modeswitch disables procedure directives inside [...] }
program tcustomattr16;
{$mode objfpc}
{$modeswitch prefixedattributes}
procedure Test; [cdecl];
begin
end;
begin
end.