Parcourir la source

* support goto/label by default in tp/delphi/macpas modes (bug 4893)

git-svn-id: trunk@2958 -
Jonas Maebe il y a 19 ans
Parent
commit
ed910b5d31

+ 5 - 0
.gitattributes

@@ -6017,6 +6017,8 @@ tests/webtbf/tw4777.pp svneol=native#text/plain
 tests/webtbf/tw4778a.pp svneol=native#text/plain
 tests/webtbf/tw4781a.pp svneol=native#text/plain
 tests/webtbf/tw4781b.pp svneol=native#text/plain
+tests/webtbf/tw4893d.pp svneol=native#text/plain
+tests/webtbf/tw4893e.pp svneol=native#text/plain
 tests/webtbf/tw4913.pp -text
 tests/webtbf/uw0744.pp svneol=native#text/plain
 tests/webtbf/uw0840a.pp svneol=native#text/plain
@@ -6752,6 +6754,9 @@ tests/webtbs/tw4768.pp -text
 tests/webtbs/tw4778.pp svneol=native#text/plain
 tests/webtbs/tw4789.pp svneol=native#text/plain
 tests/webtbs/tw4809.pp svneol=native#text/plain
+tests/webtbs/tw4893a.pp svneol=native#text/plain
+tests/webtbs/tw4893b.pp svneol=native#text/plain
+tests/webtbs/tw4893c.pp svneol=native#text/plain
 tests/webtbs/tw4898.pp -text
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 9 - 0
compiler/scanner.pas

@@ -301,6 +301,15 @@ implementation
               if changeinit then
                exclude(initlocalswitches,cs_ansistrings);
             end;
+
+           { support goto/label by default in delphi/tp7/mac modes }
+           if ([m_delphi,m_tp7,m_mac] * aktmodeswitches <> []) then
+             begin
+               include(aktmoduleswitches,cs_support_goto);
+               if changeinit then
+                 include(initmoduleswitches,cs_support_goto);
+             end;
+
            { Default enum packing for delphi/tp7 }
            if (m_tp7 in aktmodeswitches) or
               (m_delphi in aktmodeswitches) then

+ 10 - 0
tests/webtbf/tw4893d.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+{$mode fpc}
+
+label a;
+
+begin
+  goto a;
+ a:
+end.

+ 10 - 0
tests/webtbf/tw4893e.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+{$mode objfpc}
+
+label a;
+
+begin
+  goto a;
+ a:
+end.

+ 8 - 0
tests/webtbs/tw4893a.pp

@@ -0,0 +1,8 @@
+{$mode delphi}
+
+label a;
+
+begin
+  goto a;
+ a:
+end.

+ 8 - 0
tests/webtbs/tw4893b.pp

@@ -0,0 +1,8 @@
+{$mode tp}
+
+label a;
+
+begin
+  goto a;
+ a:
+end.

+ 8 - 0
tests/webtbs/tw4893c.pp

@@ -0,0 +1,8 @@
+{$mode macpas}
+
+label a;
+
+begin
+  goto a;
+ a:
+end.