Преглед изворни кода

* Some minor code cleanups (corrections of annotation, and adding FORMAL
directive to the list of directives instead of treating it like a
separate case).
(Jochem Berndsen)

git-svn-id: branches/tue@5013 -

TUeSET пре 19 година
родитељ
комит
ecd884f025
3 измењених фајлова са 7 додато и 18 уклоњено
  1. 1 1
      compiler/pdecformal.pas
  2. 6 0
      compiler/scandir.pas
  3. 0 17
      compiler/scanner.pas

+ 1 - 1
compiler/pdecformal.pas

@@ -85,7 +85,7 @@ implementation
 
         try
           repeat
-            { expect "def", "specvar", "pre" or "post" }
+            { expect "def", "specvar", "pre", "post" or "ret" }
             if (token<>_ID) then
               consume(_ID);
 

+ 6 - 0
compiler/scandir.pas

@@ -374,6 +374,11 @@ implementation
         do_message(scan_f_user_defined);
       end;
 
+    procedure dir_formal;
+      begin
+        do_localswitch(cs_formal_annotation);
+      end;
+
     procedure dir_fputype;
       begin
         current_scanner.skipspace;
@@ -1177,6 +1182,7 @@ implementation
         AddDirective('EXTENDEDSYNTAX',directive_all, @dir_extendedsyntax);
         AddDirective('EXTERNALSYM',directive_all, @dir_externalsym);
         AddDirective('FATAL',directive_all, @dir_fatal);
+        AddDirective('FORMAL',directive_all, @dir_formal);
         AddDirective('FPUTYPE',directive_all, @dir_fputype);
         AddDirective('GOTO',directive_all, @dir_goto);
         AddDirective('HINT',directive_all, @dir_hint);

+ 0 - 17
compiler/scanner.pas

@@ -1422,22 +1422,6 @@ In case not, the value returned can be arbitrary.
         mac.is_used:=true;
       end;
 
-    procedure dir_formal;
-    (* Parse comments of the form {$FORMAL+} and {$FORMAL-}
-    *)
-    var
-      s : string;
-    begin
-      s:=current_scanner.readcomment;
-      if (s='+') then 
-         include(aktlocalswitches,cs_formal_annotation)
-      else if (s='-') then
-         exclude(aktlocalswitches,cs_formal_annotation)
-      else
-         Message1(scan_w_illegal_switch,'$FORMAL '+s);
-
-    end;
-
     procedure dir_include;
 
         function findincludefile(const path,name,ext:string;var foundfile:string):boolean;
@@ -3830,7 +3814,6 @@ exit_label:
         AddDirective('I',directive_all, @dir_include);
         AddDirective('DEFINE',directive_all, @dir_define);
         AddDirective('UNDEF',directive_all, @dir_undef);
-        AddDirective('FORMAL',directive_all, @dir_formal);
 
         AddConditional('IF',directive_all, @dir_if);
         AddConditional('IFDEF',directive_all, @dir_ifdef);