From dfdbfa73d0cca44109b907b644f1b41120ab4c24 Mon Sep 17 00:00:00 2001 From: Simon Schaefer Date: Thu, 4 Apr 2013 22:45:34 +0200 Subject: SI-7300 single line comment in multi line comment This issue was fixed in 3d5c675982 but didn't get any test cases, which are added by this commit. Before, a single line comment that occurred before a closing multi line comment, like in `/*//*/`, was not treated as the beginning of a nested comment, thus the shown example was parsed as a valid comment. --- test/files/run/t7300.check | 2 ++ test/files/run/t7300.scala | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/files/run/t7300.check create mode 100644 test/files/run/t7300.scala (limited to 'test') diff --git a/test/files/run/t7300.check b/test/files/run/t7300.check new file mode 100644 index 0000000000..51993f072d --- /dev/null +++ b/test/files/run/t7300.check @@ -0,0 +1,2 @@ +2 +2 diff --git a/test/files/run/t7300.scala b/test/files/run/t7300.scala new file mode 100644 index 0000000000..ec841690df --- /dev/null +++ b/test/files/run/t7300.scala @@ -0,0 +1,11 @@ +object Test extends App { + // single line comment in multi line comment + /*//*/ val x = 1 */*/ + val x = 2 + println(x) + + // single line comment in nested multi line comment + /*/*//*/ val y = 1 */*/*/ + val y = 2 + println(y) +} -- cgit v1.2.3