Răsfoiți Sursa

* also pass the pattern with which the potential unit/namespace symbol had been found to try_consume_unitsym*()

git-svn-id: trunk@38913 -
svenbarth 7 ani în urmă
părinte
comite
e7f29e9e28
4 a modificat fișierele cu 10 adăugiri și 10 ștergeri
  1. 7 7
      compiler/pbase.pas
  2. 1 1
      compiler/pexpr.pas
  3. 1 1
      compiler/pstatmnt.pas
  4. 1 1
      compiler/ptype.pas

+ 7 - 7
compiler/pbase.pas

@@ -89,8 +89,8 @@ interface
     function consume_sym(var srsym:tsym;var srsymtable:TSymtable):boolean;
     function consume_sym(var srsym:tsym;var srsymtable:TSymtable):boolean;
     function consume_sym_orgid(var srsym:tsym;var srsymtable:TSymtable;var s : string):boolean;
     function consume_sym_orgid(var srsym:tsym;var srsymtable:TSymtable;var s : string):boolean;
 
 
-    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id,allow_specialize:boolean;out is_specialize:boolean):boolean;
-    function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id:boolean):boolean;
+    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id,allow_specialize:boolean;out is_specialize:boolean;sympattern:TSymStr):boolean;
+    function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id:boolean;sympattern:TSymStr):boolean;
 
 
     function try_consume_hintdirective(var symopt:tsymoptions; var deprecatedmsg:pshortstring):boolean;
     function try_consume_hintdirective(var symopt:tsymoptions; var deprecatedmsg:pshortstring):boolean;
 
 
@@ -205,7 +205,7 @@ implementation
           end;
           end;
         searchsym(pattern,srsym,srsymtable);
         searchsym(pattern,srsym,srsymtable);
         { handle unit specification like System.Writeln }
         { handle unit specification like System.Writeln }
-        try_consume_unitsym_no_specialize(srsym,srsymtable,t,true);
+        try_consume_unitsym_no_specialize(srsym,srsymtable,t,true,pattern);
         { if nothing found give error and return errorsym }
         { if nothing found give error and return errorsym }
         if assigned(srsym) then
         if assigned(srsym) then
           check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg)
           check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg)
@@ -238,7 +238,7 @@ implementation
           end;
           end;
         searchsym(pattern,srsym,srsymtable);
         searchsym(pattern,srsym,srsymtable);
         { handle unit specification like System.Writeln }
         { handle unit specification like System.Writeln }
-        try_consume_unitsym_no_specialize(srsym,srsymtable,t,true);
+        try_consume_unitsym_no_specialize(srsym,srsymtable,t,true,pattern);
         { if nothing found give error and return errorsym }
         { if nothing found give error and return errorsym }
         if assigned(srsym) then
         if assigned(srsym) then
           check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg)
           check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg)
@@ -254,7 +254,7 @@ implementation
       end;
       end;
 
 
 
 
-    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id,allow_specialize:boolean;out is_specialize:boolean):boolean;
+    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id,allow_specialize:boolean;out is_specialize:boolean;sympattern:TSymStr):boolean;
       var
       var
         hmodule: tmodule;
         hmodule: tmodule;
         ns:ansistring;
         ns:ansistring;
@@ -360,11 +360,11 @@ implementation
       end;
       end;
 
 
 
 
-    function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id:boolean):boolean;
+    function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id:boolean;sympattern:TSymStr):boolean;
       var
       var
         dummy: Boolean;
         dummy: Boolean;
       begin
       begin
-        result:=try_consume_unitsym(srsym,srsymtable,tokentoconsume,consume_id,false,dummy);
+        result:=try_consume_unitsym(srsym,srsymtable,tokentoconsume,consume_id,false,dummy,sympattern);
       end;
       end;
 
 
     function try_consume_hintdirective(var symopt:tsymoptions; var deprecatedmsg:pshortstring):boolean;
     function try_consume_hintdirective(var symopt:tsymoptions; var deprecatedmsg:pshortstring):boolean;

+ 1 - 1
compiler/pexpr.pas

@@ -2810,7 +2810,7 @@ implementation
                  searchsym(pattern,srsym,srsymtable);
                  searchsym(pattern,srsym,srsymtable);
                { handle unit specification like System.Writeln }
                { handle unit specification like System.Writeln }
                if not isspecialize then
                if not isspecialize then
-                 unit_found:=try_consume_unitsym(srsym,srsymtable,t,true,allowspecialize,isspecialize)
+                 unit_found:=try_consume_unitsym(srsym,srsymtable,t,true,allowspecialize,isspecialize,pattern)
                else
                else
                  begin
                  begin
                    unit_found:=false;
                    unit_found:=false;

+ 1 - 1
compiler/pstatmnt.pas

@@ -948,7 +948,7 @@ implementation
                                  with "e: Exception" the e is not necessary }
                                  with "e: Exception" the e is not necessary }
 
 
                                { support unit.identifier }
                                { support unit.identifier }
-                               unit_found:=try_consume_unitsym_no_specialize(srsym,srsymtable,t,false);
+                               unit_found:=try_consume_unitsym_no_specialize(srsym,srsymtable,t,false,objname);
                                if srsym=nil then
                                if srsym=nil then
                                  begin
                                  begin
                                    identifier_not_found(orgpattern);
                                    identifier_not_found(orgpattern);

+ 1 - 1
compiler/ptype.pas

@@ -376,7 +376,7 @@ implementation
            not_a_type:=false;
            not_a_type:=false;
          { handle unit specification like System.Writeln }
          { handle unit specification like System.Writeln }
          if allowunitsym then
          if allowunitsym then
-           is_unit_specific:=try_consume_unitsym(srsym,srsymtable,t,true,true,is_specialize)
+           is_unit_specific:=try_consume_unitsym(srsym,srsymtable,t,true,true,is_specialize,s)
          else
          else
            begin
            begin
              t:=_ID;
              t:=_ID;