Skip to content

Commit bef40b4

Browse files
authored
Merge pull request #1383 from kcsongor/master
Fix 1375: Infinite loop in interpreter
2 parents 6ca5b9d + 7668729 commit bef40b4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/dotty/tools/dotc/printing/SyntaxHighlighting.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ object SyntaxHighlighting {
7777
(n: @switch) match {
7878
case '/' =>
7979
if (remaining.nonEmpty) {
80-
takeChar() match {
81-
case '/' => eolComment()
82-
case '*' => blockComment()
83-
case x => newBuf += '/'; remaining = x #:: remaining
80+
remaining.head match {
81+
case '/' =>
82+
takeChar()
83+
eolComment()
84+
case '*' =>
85+
takeChar()
86+
blockComment()
87+
case x =>
88+
newBuf += '/'
8489
}
8590
} else newBuf += '/'
8691
case '=' =>

0 commit comments

Comments
 (0)