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:
svenbarth 2015-09-04 13:27:28 +00:00
parent cbaa02e7b5
commit 267adf4e46

View File

@ -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;