Selaa lähdekoodia

* handle Delphi's $DEFINITIONINFO and $YD like $REFERENCEINFO as the unsupported $Y switch
+ added test

Sven/Sarah Barth 4 päivää sitten
vanhempi
commit
aeb3ea06d4
2 muutettua tiedostoa jossa 29 lisäystä ja 0 poistoa
  1. 12 0
      compiler/scandir.pas
  2. 17 0
      tests/tbs/tb0723.pp

+ 12 - 0
compiler/scandir.pas

@@ -475,6 +475,11 @@ unit scandir;
         do_delphiswitch('D');
       end;
 
+    procedure dir_definitioninfo;
+      begin
+        do_delphiswitch('Y');
+      end;
+
     procedure dir_denypackageunit;
       begin
         do_moduleflagswitch(mf_package_deny,true);
@@ -2015,6 +2020,11 @@ unit scandir;
         do_delphiswitch('J');
       end;
 
+    procedure dir_yd;
+      begin
+        HandleSwitch('Y','+');
+      end;
+
     procedure dir_z1;
       begin
         current_settings.packenum:=1;
@@ -2198,6 +2208,7 @@ unit scandir;
         AddDirective('COPYRIGHT',directive_all, @dir_copyright);
         AddDirective('D',directive_all, @dir_description);
         AddDirective('DEBUGINFO',directive_all, @dir_debuginfo);
+        AddDirective('DEFINITIONINFO',directive_all, @dir_definitioninfo);
         AddDirective('DENYPACKAGEUNIT',directive_all,@dir_denypackageunit);
         AddDirective('DESCRIPTION',directive_all, @dir_description);
         AddDirective('ENDREGION',directive_all, @dir_endregion);
@@ -2309,6 +2320,7 @@ unit scandir;
         AddDirective('WARNINGS',directive_all, @dir_warnings);
         AddDirective('WEAKPACKAGEUNIT',directive_all, @dir_weakpackageunit);
         AddDirective('WRITEABLECONST',directive_all, @dir_writeableconst);
+        AdDDirective('YD',directive_all, @dir_yd);
         AddDirective('Z1',directive_all, @dir_z1);
         AddDirective('Z2',directive_all, @dir_z2);
         AddDirective('Z4',directive_all, @dir_z4);

+ 17 - 0
tests/tbs/tb0723.pp

@@ -0,0 +1,17 @@
+{ %NORUN }
+{ %OPT=-Sew }
+
+{$warn 2041 off}
+program tb0723;
+
+
+{$YD}
+{$Y-}
+{$Y+}
+{$REFERENCEINFO ON}
+{$REFERENCEINFO OFF}
+{$DEFINITIONINFO ON}
+{$DEFINITIONINFO OFF}
+
+begin
+end.