From 362ff5ad011c58789a547f662879a9fb36a34d69 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 10 May 2014 16:03:02 +0000 Subject: [PATCH] * only check for _PROPERTY as a regular token, so that {$modeswitch properties-} also affects global properties (mantis #25861) git-svn-id: trunk@27758 - --- .gitattributes | 1 + compiler/psub.pas | 16 ++++++++-------- tests/webtbf/tw25861.pp | 8 ++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 tests/webtbf/tw25861.pp diff --git a/.gitattributes b/.gitattributes index 30d2eb4ddf..9e6f0adf94 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/psub.pas b/compiler/psub.pas index b1acf1191c..6d096af576 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -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; diff --git a/tests/webtbf/tw25861.pp b/tests/webtbf/tw25861.pp new file mode 100644 index 0000000000..183fc5186b --- /dev/null +++ b/tests/webtbf/tw25861.pp @@ -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. +