Browse Source

* use tparse_proc_flags for parse_proc_head as well

Sven/Sarah Barth 4 years ago
parent
commit
9664ad4138
3 changed files with 15 additions and 15 deletions
  1. 4 4
      compiler/pdecobj.pas
  2. 10 10
      compiler/pdecsub.pas
  3. 1 1
      compiler/pgenutil.pas

+ 4 - 4
compiler/pdecobj.pas

@@ -105,7 +105,7 @@ implementation
         result:=nil;
         consume(_CONSTRUCTOR);
         { must be at same level as in implementation }
-        parse_proc_head(current_structdef,potype_class_constructor,false,nil,nil,pd);
+        parse_proc_head(current_structdef,potype_class_constructor,[],nil,nil,pd);
         if not assigned(pd) then
           begin
             consume(_SEMICOLON);
@@ -130,7 +130,7 @@ implementation
         result:=nil;
         consume(_CONSTRUCTOR);
         { must be at same level as in implementation }
-        parse_proc_head(current_structdef,potype_constructor,false,nil,nil,pd);
+        parse_proc_head(current_structdef,potype_constructor,[],nil,nil,pd);
         if not assigned(pd) then
           begin
             consume(_SEMICOLON);
@@ -244,7 +244,7 @@ implementation
       begin
         result:=nil;
         consume(_DESTRUCTOR);
-        parse_proc_head(current_structdef,potype_class_destructor,false,nil,nil,pd);
+        parse_proc_head(current_structdef,potype_class_destructor,[],nil,nil,pd);
         if not assigned(pd) then
           begin
             consume(_SEMICOLON);
@@ -268,7 +268,7 @@ implementation
       begin
         result:=nil;
         consume(_DESTRUCTOR);
-        parse_proc_head(current_structdef,potype_destructor,false,nil,nil,pd);
+        parse_proc_head(current_structdef,potype_destructor,[],nil,nil,pd);
         if not assigned(pd) then
           begin
             consume(_SEMICOLON);

+ 10 - 10
compiler/pdecsub.pas

@@ -71,7 +71,7 @@ interface
     procedure parse_var_proc_directives(sym:tsym);
     procedure parse_object_proc_directives(pd:tabstractprocdef);
     procedure parse_record_proc_directives(pd:tabstractprocdef);
-    function  parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;isgeneric:boolean;genericdef:tdef;generictypelist:tfphashobjectlist;out pd:tprocdef):boolean;
+    function  parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;flags:tparse_proc_flags;genericdef:tdef;generictypelist:tfphashobjectlist;out pd:tprocdef):boolean;
     function  parse_proc_dec(flags:tparse_proc_flags;astruct:tabstractrecorddef):tprocdef;
     procedure parse_proc_dec_finish(pd:tprocdef;isclassmethod:boolean;astruct:tabstractrecorddef);
 
@@ -530,7 +530,7 @@ implementation
       end;
 
 
-    function parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;isgeneric:boolean;genericdef:tdef;generictypelist:tfphashobjectlist;out pd:tprocdef):boolean;
+    function parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;flags:tparse_proc_flags;genericdef:tdef;generictypelist:tfphashobjectlist;out pd:tprocdef):boolean;
       var
         hs       : string;
         orgsp,sp,orgspnongen,spnongen : TIDString;
@@ -663,7 +663,7 @@ implementation
                     (idtoken=_SPECIALIZE) then
                   hadspecialize:=true;
                 consume(_ID);
-                if (isgeneric or (m_delphi in current_settings.modeswitches)) and
+                if ((ppf_generic in flags) or (m_delphi in current_settings.modeswitches)) and
                     (token in [_LT,_LSHARPBRACKET]) then
                   begin
                     consume(token);
@@ -1628,7 +1628,7 @@ implementation
           _FUNCTION :
             begin
               consume(_FUNCTION);
-              if parse_proc_head(astruct,potype_function,ppf_generic in flags,nil,nil,pd) then
+              if parse_proc_head(astruct,potype_function,flags,nil,nil,pd) then
                 begin
                   { pd=nil when it is a interface mapping }
                   if assigned(pd) then
@@ -1648,7 +1648,7 @@ implementation
           _PROCEDURE :
             begin
               consume(_PROCEDURE);
-              if parse_proc_head(astruct,potype_procedure,ppf_generic in flags,nil,nil,pd) then
+              if parse_proc_head(astruct,potype_procedure,flags,nil,nil,pd) then
                 begin
                   { pd=nil when it is an interface mapping }
                   if assigned(pd) then
@@ -1664,9 +1664,9 @@ implementation
             begin
               consume(_CONSTRUCTOR);
               if ppf_classmethod in flags then
-                recover:=not parse_proc_head(astruct,potype_class_constructor,false,nil,nil,pd)
+                recover:=not parse_proc_head(astruct,potype_class_constructor,[],nil,nil,pd)
               else
-                recover:=not parse_proc_head(astruct,potype_constructor,false,nil,nil,pd);
+                recover:=not parse_proc_head(astruct,potype_constructor,[],nil,nil,pd);
               if not recover then
                 parse_proc_dec_finish(pd,ppf_classmethod in flags,astruct);
             end;
@@ -1675,9 +1675,9 @@ implementation
             begin
               consume(_DESTRUCTOR);
               if ppf_classmethod in flags then
-                recover:=not parse_proc_head(astruct,potype_class_destructor,false,nil,nil,pd)
+                recover:=not parse_proc_head(astruct,potype_class_destructor,[],nil,nil,pd)
               else
-                recover:=not parse_proc_head(astruct,potype_destructor,false,nil,nil,pd);
+                recover:=not parse_proc_head(astruct,potype_destructor,[],nil,nil,pd);
               if not recover then
                 parse_proc_dec_finish(pd,ppf_classmethod in flags,astruct);
             end;
@@ -1691,7 +1691,7 @@ implementation
               old_block_type:=block_type;
               block_type:=bt_body;
               consume(_OPERATOR);
-              parse_proc_head(astruct,potype_operator,false,nil,nil,pd);
+              parse_proc_head(astruct,potype_operator,[],nil,nil,pd);
               block_type:=old_block_type;
               if assigned(pd) then
                 parse_proc_dec_finish(pd,ppf_classmethod in flags,astruct)

+ 1 - 1
compiler/pgenutil.pas

@@ -1917,7 +1917,7 @@ uses
                 if genericdef.typ=procdef then
                   begin
                     current_scanner.startreplaytokens(tprocdef(genericdef).genericdecltokenbuf,hmodule.change_endian);
-                    parse_proc_head(tprocdef(genericdef).struct,tprocdef(genericdef).proctypeoption,false,genericdef,generictypelist,pd);
+                    parse_proc_head(tprocdef(genericdef).struct,tprocdef(genericdef).proctypeoption,[],genericdef,generictypelist,pd);
                     if assigned(pd) then
                       begin
                         if assigned(psym) then