* only check for _PROPERTY as a regular token, so that

{$modeswitch properties-} also affects global properties
    (mantis #25861)

git-svn-id: trunk@27758 -
This commit is contained in:
Jonas Maebe 2014-05-10 16:03:02 +00:00
parent dc17b7ef46
commit 362ff5ad01
3 changed files with 17 additions and 8 deletions

1
.gitattributes vendored
View File

@ -12734,6 +12734,7 @@ tests/webtbf/tw2562.pp svneol=native#text/plain
tests/webtbf/tw25622.pp svneol=native#text/plain
tests/webtbf/tw25622a.pp svneol=native#text/plain
tests/webtbf/tw25788.pp svneol=native#text/pascal
tests/webtbf/tw25861.pp svneol=native#text/plain
tests/webtbf/tw25862.pp svneol=native#text/plain
tests/webtbf/tw25915.pp svneol=native#text/pascal
tests/webtbf/tw25951.pp svneol=native#text/pascal

View File

@ -2210,7 +2210,14 @@ implementation
Message(parser_w_unsupported_feature);
consume(_BEGIN);
end;
end
end;
_PROPERTY:
begin
if (m_fpc in current_settings.modeswitches) then
property_dec
else
break;
end;
else
begin
case idtoken of
@ -2233,13 +2240,6 @@ implementation
else
break;
end;
_PROPERTY:
begin
if (m_fpc in current_settings.modeswitches) then
property_dec
else
break;
end;
else
break;
end;

8
tests/webtbf/tw25861.pp Normal file
View File

@ -0,0 +1,8 @@
{ %fail }
{$MODE OBJFPC} {$MODESWITCH PROPERTIES-}
program test;
function GetBar(): Cardinal; begin Result := 0; end;
property Bar: Cardinal read GetBar;
begin Writeln(Bar); end.