Browse Source

* increase comment nesting level when "(*" is followed by another '*'
(mantis #32019)

git-svn-id: trunk@37935 -

Jonas Maebe 7 years ago
parent
commit
5f7d3e16f5
3 changed files with 19 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 5 1
      compiler/scanner.pas
  3. 13 0
      tests/webtbs/tw32019.pp

+ 1 - 0
.gitattributes

@@ -15901,6 +15901,7 @@ tests/webtbs/tw3185.pp svneol=native#text/plain
 tests/webtbs/tw3190.pp svneol=native#text/plain
 tests/webtbs/tw3190.pp svneol=native#text/plain
 tests/webtbs/tw31945.pp svneol=native#text/pascal
 tests/webtbs/tw31945.pp svneol=native#text/pascal
 tests/webtbs/tw3197.pp svneol=native#text/plain
 tests/webtbs/tw3197.pp svneol=native#text/plain
+tests/webtbs/tw32019.pp svneol=native#text/plain
 tests/webtbs/tw32040.pp svneol=native#text/pascal
 tests/webtbs/tw32040.pp svneol=native#text/pascal
 tests/webtbs/tw32043.pp svneol=native#text/pascal
 tests/webtbs/tw32043.pp svneol=native#text/pascal
 tests/webtbs/tw32046.pp svneol=native#text/plain
 tests/webtbs/tw32046.pp svneol=native#text/plain

+ 5 - 1
compiler/scanner.pas

@@ -4548,7 +4548,11 @@ type
                    if found=3 then
                    if found=3 then
                     found:=4
                     found:=4
                    else
                    else
-                    found:=1;
+                    begin
+                      if found=4 then
+                        inc_comment_level;
+                      found:=1;
+                    end;
                  end;
                  end;
                ')' :
                ')' :
                  begin
                  begin

+ 13 - 0
tests/webtbs/tw32019.pp

@@ -0,0 +1,13 @@
+{ %fail }
+
+program Project1;
+
+{$ModeSwitch nestedcomments}
+
+(*
+(***)
+
+begin
+  writeln('see');
+  readln;
+end.