mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 23:19:29 +02:00
scanner.pas, tscanner:
+ new method to check how many token replays are currently active. This is needed for example to determine the end of a generic method which may contain modifiers and such. git-svn-id: trunk@31506 -
This commit is contained in:
parent
cbaa02e7b5
commit
267adf4e46
@ -172,6 +172,7 @@ interface
|
||||
procedure elseifpreprocstack(compile_time_predicate:tcompile_time_predicate);
|
||||
procedure elsepreprocstack;
|
||||
procedure popreplaystack;
|
||||
function replay_stack_depth:longint;
|
||||
procedure handleconditional(p:tdirectiveitem);
|
||||
procedure handledirectives;
|
||||
procedure linebreak;
|
||||
@ -3770,6 +3771,20 @@ type
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function tscannerfile.replay_stack_depth:longint;
|
||||
var
|
||||
tmp: treplaystack;
|
||||
begin
|
||||
result:=0;
|
||||
tmp:=replaystack;
|
||||
while assigned(tmp) do
|
||||
begin
|
||||
inc(result);
|
||||
tmp:=tmp.next;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure tscannerfile.handleconditional(p:tdirectiveitem);
|
||||
begin
|
||||
savetokenpos;
|
||||
|
Loading…
Reference in New Issue
Block a user