2
0
Эх сурвалжийг харах

* openstring now uses a type in the system unit

git-svn-id: trunk@3053 -
peter 19 жил өмнө
parent
commit
2ee71781a7

+ 1 - 0
.gitattributes

@@ -6760,6 +6760,7 @@ 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/tw4826.pp svneol=native#text/plain
+tests/webtbs/tw4881.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

+ 7 - 18
compiler/pdecsub.pas

@@ -518,26 +518,15 @@ implementation
               end
              else
               begin
+                if (m_mac in aktmodeswitches) then
+                  try_to_consume(_UNIV); {currently does nothing}
+                single_type(tt,false);
+
                 { open string ? }
                 if (varspez in [vs_out,vs_var]) and
-                        (
-                          (
-                            ((token=_STRING) or (idtoken=_SHORTSTRING)) and
-                            (cs_openstring in aktmoduleswitches) and
-                            not(cs_ansistrings in aktlocalswitches)
-                          ) or
-                        (idtoken=_OPENSTRING)) then
-                 begin
-                   consume(token);
-                   tt:=openshortstringtype;
-                 end
-                else
-                 begin
-                   { everything else }
-                   if (m_mac in aktmodeswitches) then
-                     try_to_consume(_UNIV); {currently does nothing}
-                   single_type(tt,false);
-                 end;
+                   (cs_openstring in aktmoduleswitches) and
+                   is_shortstring(tt.def) then
+                  tt:=openshortstringtype;
 
                 if (target_info.system in [system_powerpc_morphos,system_m68k_amiga]) then
                   begin

+ 1 - 0
compiler/psystem.pas

@@ -240,6 +240,7 @@ implementation
 {$endif support_longstring}
         addtype('AnsiString',cansistringtype);
         addtype('WideString',cwidestringtype);
+        addtype('OpenString',openshortstringtype);
         addtype('Boolean',booltype);
         addtype('ByteBool',booltype);
         adddef('WordBool',torddef.create(bool16bit,0,1));

+ 14 - 0
tests/webtbs/tw4881.pp

@@ -0,0 +1,14 @@
+{ Source provided for Free Pascal Bug Report 4881 }
+{ Submitted by "Jasper Neumann" on  2006-03-07 }
+{ e-mail: [email protected] }
+type
+  openstring=integer;
+
+procedure test(var x:openstring);
+begin end;
+
+var
+  x: openstring;
+begin
+  test(x);
+end.