aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/printing/SyntaxHighlighting.scala')
-rw-r--r--src/dotty/tools/dotc/printing/SyntaxHighlighting.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala b/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
index 8a79e1ddc..67aa24243 100644
--- a/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
+++ b/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
@@ -77,10 +77,15 @@ object SyntaxHighlighting {
(n: @switch) match {
case '/' =>
if (remaining.nonEmpty) {
- takeChar() match {
- case '/' => eolComment()
- case '*' => blockComment()
- case x => newBuf += '/'; remaining = x #:: remaining
+ remaining.head match {
+ case '/' =>
+ takeChar()
+ eolComment()
+ case '*' =>
+ takeChar()
+ blockComment()
+ case x =>
+ newBuf += '/'
}
} else newBuf += '/'
case '=' =>