mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 16:40:28 +02:00
* change boolean parameters for try_consume_unitsym to a set
git-svn-id: trunk@42360 -
This commit is contained in:
parent
39bab2dbcc
commit
ed5f19e7e3
@ -89,8 +89,15 @@ 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;sympattern:TSymStr):boolean;
|
type
|
||||||
function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id:boolean;sympattern:TSymStr):boolean;
|
tconsume_unitsym_flag = (
|
||||||
|
cuf_consume_id,
|
||||||
|
cuf_allow_specialize
|
||||||
|
);
|
||||||
|
tconsume_unitsym_flags = set of tconsume_unitsym_flag;
|
||||||
|
|
||||||
|
function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;flags:tconsume_unitsym_flags;out is_specialize:boolean;sympattern:TSymStr):boolean;
|
||||||
|
function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;flags:tconsume_unitsym_flags;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 +212,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,pattern);
|
try_consume_unitsym_no_specialize(srsym,srsymtable,t,[cuf_consume_id],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 +245,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,pattern);
|
try_consume_unitsym_no_specialize(srsym,srsymtable,t,[cuf_consume_id],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 +261,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;sympattern:TSymStr):boolean;
|
function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;flags:tconsume_unitsym_flags;out is_specialize:boolean;sympattern:TSymStr):boolean;
|
||||||
var
|
var
|
||||||
hmodule: tmodule;
|
hmodule: tmodule;
|
||||||
ns:ansistring;
|
ns:ansistring;
|
||||||
@ -318,7 +325,7 @@ implementation
|
|||||||
internalerror(201001120);
|
internalerror(201001120);
|
||||||
if hmodule.unit_index=current_filepos.moduleindex then
|
if hmodule.unit_index=current_filepos.moduleindex then
|
||||||
begin
|
begin
|
||||||
if consume_id then
|
if cuf_consume_id in flags then
|
||||||
consume(_ID);
|
consume(_ID);
|
||||||
consume(_POINT);
|
consume(_POINT);
|
||||||
if srsym.typ=namespacesym then
|
if srsym.typ=namespacesym then
|
||||||
@ -365,7 +372,7 @@ implementation
|
|||||||
searchsym_in_module(tunitsym(srsym).module,'ANSICHAR',srsym,srsymtable)
|
searchsym_in_module(tunitsym(srsym).module,'ANSICHAR',srsym,srsymtable)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if allow_specialize and (idtoken=_SPECIALIZE) then
|
if (cuf_allow_specialize in flags) and (idtoken=_SPECIALIZE) then
|
||||||
begin
|
begin
|
||||||
consume(_ID);
|
consume(_ID);
|
||||||
is_specialize:=true;
|
is_specialize:=true;
|
||||||
@ -405,11 +412,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;consume_id:boolean;sympattern:TSymStr):boolean;
|
function try_consume_unitsym_no_specialize(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken;flags:tconsume_unitsym_flags;sympattern:TSymStr):boolean;
|
||||||
var
|
var
|
||||||
dummy: Boolean;
|
dummy: Boolean;
|
||||||
begin
|
begin
|
||||||
result:=try_consume_unitsym(srsym,srsymtable,tokentoconsume,consume_id,false,dummy,sympattern);
|
exclude(flags,cuf_allow_specialize);
|
||||||
|
result:=try_consume_unitsym(srsym,srsymtable,tokentoconsume,flags,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;
|
||||||
|
@ -2833,6 +2833,7 @@ implementation
|
|||||||
dummypos,
|
dummypos,
|
||||||
tokenpos: tfileposinfo;
|
tokenpos: tfileposinfo;
|
||||||
spezcontext : tspecializationcontext;
|
spezcontext : tspecializationcontext;
|
||||||
|
cufflags : tconsume_unitsym_flags;
|
||||||
begin
|
begin
|
||||||
{ allow post fix operators }
|
{ allow post fix operators }
|
||||||
again:=true;
|
again:=true;
|
||||||
@ -2872,7 +2873,12 @@ 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,pattern)
|
begin
|
||||||
|
cufflags:=[cuf_consume_id];
|
||||||
|
if allowspecialize then
|
||||||
|
include(cufflags,cuf_allow_specialize);
|
||||||
|
unit_found:=try_consume_unitsym(srsym,srsymtable,t,cufflags,isspecialize,pattern)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
unit_found:=false;
|
unit_found:=false;
|
||||||
|
@ -951,7 +951,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,objname);
|
unit_found:=try_consume_unitsym_no_specialize(srsym,srsymtable,t,[],objname);
|
||||||
if srsym=nil then
|
if srsym=nil then
|
||||||
begin
|
begin
|
||||||
identifier_not_found(orgpattern);
|
identifier_not_found(orgpattern);
|
||||||
|
@ -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,s)
|
is_unit_specific:=try_consume_unitsym(srsym,srsymtable,t,[cuf_consume_id,cuf_allow_specialize],is_specialize,s)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
t:=_ID;
|
t:=_ID;
|
||||||
|
Loading…
Reference in New Issue
Block a user