Browse Source

* correctly read the region label in $region directives, resolves #39395

florian 3 years ago
parent
commit
95ad8f1694
2 changed files with 8 additions and 0 deletions
  1. 2 0
      compiler/scandir.pas
  2. 6 0
      tests/webtbs/tw39395.pp

+ 2 - 0
compiler/scandir.pas

@@ -1914,6 +1914,8 @@ unit scandir;
 
 
     procedure dir_region;
     procedure dir_region;
       begin
       begin
+        current_scanner.skipspace;
+        current_scanner.readquotedstring;
       end;
       end;
 
 
     procedure dir_endregion;
     procedure dir_endregion;

+ 6 - 0
tests/webtbs/tw39395.pp

@@ -0,0 +1,6 @@
+{$mode delphi}
+
+{$region ' { somelabel } '}
+
+begin
+end.