Browse Source

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 -

svenbarth 10 years ago
parent
commit
267adf4e46
1 changed files with 15 additions and 0 deletions
  1. 15 0
      compiler/scanner.pas

+ 15 - 0
compiler/scanner.pas

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