Merged revisions 2417 via svnmerge from

svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/trunk

r2417 (jonas)
  * fixed displaying of hints such for procedures and functions
    (and moved check_hints from pbase to htypechk)

git-svn-id: branches/fixes_2_0@2418 -
This commit is contained in:
Jonas Maebe 2006-02-03 18:22:10 +00:00
parent a534f34615
commit b795045347
3 changed files with 26 additions and 27 deletions

View File

@ -148,6 +148,8 @@ interface
function valid_for_addr(p : tnode; report_errors: boolean) : boolean;
procedure check_hints(const srsym: tsym; const symoptions: tsymoptions);
implementation
uses
@ -2192,4 +2194,17 @@ implementation
end;
procedure check_hints(const srsym: tsym; const symoptions: tsymoptions);
begin
if not assigned(srsym) then
exit;
if sp_hint_deprecated in symoptions then
Message1(sym_w_deprecated_symbol,srsym.realname);
if sp_hint_platform in symoptions then
Message1(sym_w_non_portable_symbol,srsym.realname);
if sp_hint_unimplemented in symoptions then
Message1(sym_w_non_implemented_symbol,srsym.realname);
end;
end.

View File

@ -87,8 +87,6 @@ interface
function try_consume_hintdirective(var symopt:tsymoptions):boolean;
procedure check_hints(const srsym: tsym);
{ just for an accurate position of the end of a procedure (PM) }
var
last_endtoken_filepos: tfileposinfo;
@ -97,7 +95,7 @@ interface
implementation
uses
globtype,scanner,systems,verbose;
globtype,htypechk,scanner,systems,verbose;
{****************************************************************************
Token Parsing
@ -177,20 +175,6 @@ implementation
{ check if a symbol contains the hint directive, and if so gives out a hint
if required.
}
procedure check_hints(const srsym: tsym);
begin
if not assigned(srsym) then
exit;
if sp_hint_deprecated in srsym.symoptions then
Message1(sym_w_deprecated_symbol,srsym.realname);
if sp_hint_platform in srsym.symoptions then
Message1(sym_w_non_portable_symbol,srsym.realname);
if sp_hint_unimplemented in srsym.symoptions then
Message1(sym_w_non_implemented_symbol,srsym.realname);
end;
function consume_sym(var srsym:tsym;var srsymtable:tsymtable):boolean;
begin
{ first check for identifier }
@ -203,7 +187,7 @@ implementation
exit;
end;
searchsym(pattern,srsym,srsymtable);
check_hints(srsym);
check_hints(srsym,srsym.symoptions);
if assigned(srsym) then
begin
if (srsym.typ=unitsym) then

View File

@ -1170,7 +1170,7 @@ implementation
begin
static_name:=lower(sym.owner.name^)+'_'+sym.name;
searchsym(static_name,sym,srsymtable);
check_hints(sym);
check_hints(sym,sym.symoptions);
p1.free;
p1:=cloadnode.create(sym,srsymtable);
end
@ -1270,7 +1270,7 @@ implementation
begin
static_name:=lower(srsym.owner.name^)+'_'+srsym.name;
searchsym(static_name,srsym,srsymtable);
check_hints(srsym);
check_hints(srsym,srsym.symoptions);
end
else
begin
@ -1343,7 +1343,7 @@ implementation
p1:=ctypenode.create(htype);
{ search also in inherited methods }
srsym:=searchsym_in_class(tobjectdef(htype.def),pattern);
check_hints(srsym);
check_hints(srsym,srsym.symoptions);
consume(_ID);
do_member_read(tobjectdef(htype.def),false,srsym,p1,again,[]);
end
@ -1361,7 +1361,7 @@ implementation
{ TP allows also @TMenu.Load if Load is only }
{ defined in an anchestor class }
srsym:=search_class_member(tobjectdef(htype.def),pattern);
check_hints(srsym);
check_hints(srsym,srsym.symoptions);
if not assigned(srsym) then
Message1(sym_e_id_no_member,orgpattern)
else if not(getaddr) and not(sp_static in srsym.symoptions) then
@ -1387,7 +1387,7 @@ implementation
{ TP allows also @TMenu.Load if Load is only }
{ defined in an anchestor class }
srsym:=search_class_member(tobjectdef(htype.def),pattern);
check_hints(srsym);
check_hints(srsym,srsym.symoptions);
if not assigned(srsym) then
Message1(sym_e_id_no_member,orgpattern)
else
@ -1848,7 +1848,7 @@ implementation
if token=_ID then
begin
hsym:=tsym(trecorddef(p1.resulttype.def).symtable.search(pattern));
check_hints(hsym);
check_hints(hsym,hsym.symoptions);
if assigned(hsym) and
(hsym.typ=fieldvarsym) then
p1:=csubscriptnode.create(hsym,p1)
@ -1870,7 +1870,7 @@ implementation
begin
classh:=tobjectdef(tclassrefdef(p1.resulttype.def).pointertype.def);
hsym:=searchsym_in_class(classh,pattern);
check_hints(hsym);
check_hints(hsym,hsym.symoptions);
if hsym=nil then
begin
Message1(sym_e_id_no_member,orgpattern);
@ -1896,7 +1896,7 @@ implementation
allow_only_static:=false;
classh:=tobjectdef(p1.resulttype.def);
hsym:=searchsym_in_class(classh,pattern);
check_hints(hsym);
check_hints(hsym,hsym.symoptions);
allow_only_static:=store_static;
if hsym=nil then
begin
@ -2078,7 +2078,7 @@ implementation
end;
if assigned(sym) then
begin
check_hints(sym);
check_hints(sym,sym.symoptions);
{ load the procdef from the inherited class and
not from self }
if sym.typ in [procsym,propertysym] then