mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-25 19:37:26 +01:00
* export of qualified unit symbols, fixes #6848
git-svn-id: trunk@3570 -
This commit is contained in:
parent
f27fa0d24f
commit
3824604e8a
@ -81,6 +81,7 @@ interface
|
|||||||
{ consume a symbol, if not found give an error and
|
{ consume a symbol, if not found give an error and
|
||||||
and return an errorsym }
|
and return an errorsym }
|
||||||
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 try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
|
function try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
|
||||||
|
|
||||||
@ -173,6 +174,9 @@ implementation
|
|||||||
|
|
||||||
{ check if a symbol contains the hint directive, and if so gives out a hint
|
{ check if a symbol contains the hint directive, and if so gives out a hint
|
||||||
if required.
|
if required.
|
||||||
|
|
||||||
|
If this code is changed, it's like that consume_sym_orgid must be changed
|
||||||
|
as well (FK)
|
||||||
}
|
}
|
||||||
function consume_sym(var srsym:tsym;var srsymtable:tsymtable):boolean;
|
function consume_sym(var srsym:tsym;var srsymtable:tsymtable):boolean;
|
||||||
begin
|
begin
|
||||||
@ -202,6 +206,37 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ check if a symbol contains the hint directive, and if so gives out a hint
|
||||||
|
if required and returns the id with it's original casing
|
||||||
|
}
|
||||||
|
function consume_sym_orgid(var srsym:tsym;var srsymtable:tsymtable;var s : string):boolean;
|
||||||
|
begin
|
||||||
|
{ first check for identifier }
|
||||||
|
if token<>_ID then
|
||||||
|
begin
|
||||||
|
consume(_ID);
|
||||||
|
srsym:=generrorsym;
|
||||||
|
srsymtable:=nil;
|
||||||
|
result:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
searchsym(pattern,srsym,srsymtable);
|
||||||
|
{ handle unit specification like System.Writeln }
|
||||||
|
try_consume_unitsym(srsym,srsymtable);
|
||||||
|
{ if nothing found give error and return errorsym }
|
||||||
|
if assigned(srsym) then
|
||||||
|
check_hints(srsym,srsym.symoptions)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
identifier_not_found(orgpattern);
|
||||||
|
srsym:=generrorsym;
|
||||||
|
srsymtable:=nil;
|
||||||
|
end;
|
||||||
|
s:=orgpattern;
|
||||||
|
consume(_ID);
|
||||||
|
result:=assigned(srsym);
|
||||||
|
end;
|
||||||
|
|
||||||
function try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
|
function try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
|
|||||||
@ -85,8 +85,8 @@ implementation
|
|||||||
hp:=texported_item.create;
|
hp:=texported_item.create;
|
||||||
if token=_ID then
|
if token=_ID then
|
||||||
begin
|
begin
|
||||||
orgs:=orgpattern;
|
consume_sym_orgid(srsym,srsymtable,orgs);
|
||||||
consume_sym(srsym,srsymtable);
|
{ orgpattern is still valid here }
|
||||||
hp.sym:=srsym;
|
hp.sym:=srsym;
|
||||||
InternalProcName:='';
|
InternalProcName:='';
|
||||||
case srsym.typ of
|
case srsym.typ of
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user