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

git-svn-id: trunk@38913 -
This commit is contained in:
svenbarth 2018-05-05 17:18:31 +00:00
parent c0dcb505e2
commit e7f29e9e28
4 changed files with 10 additions and 10 deletions

View File

@ -89,8 +89,8 @@ interface
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 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;
@ -205,7 +205,7 @@ implementation
end;
searchsym(pattern,srsym,srsymtable);
{ 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 assigned(srsym) then
check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg)
@ -238,7 +238,7 @@ implementation
end;
searchsym(pattern,srsym,srsymtable);
{ 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 assigned(srsym) then
check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg)
@ -254,7 +254,7 @@ implementation
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
hmodule: tmodule;
ns:ansistring;
@ -360,11 +360,11 @@ implementation
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
dummy: Boolean;
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;
function try_consume_hintdirective(var symopt:tsymoptions; var deprecatedmsg:pshortstring):boolean;

View File

@ -2810,7 +2810,7 @@ implementation
searchsym(pattern,srsym,srsymtable);
{ handle unit specification like System.Writeln }
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
begin
unit_found:=false;

View File

@ -948,7 +948,7 @@ implementation
with "e: Exception" the e is not necessary }
{ 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
begin
identifier_not_found(orgpattern);

View File

@ -376,7 +376,7 @@ implementation
not_a_type:=false;
{ handle unit specification like System.Writeln }
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
begin
t:=_ID;