diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-07-12 21:56:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-12 21:56:37 +0200 |
commit | bef40b45f6c15bf55fa73ea7923cb4da74cf77d0 (patch) | |
tree | 972a1e5147fac1dd56bd1976c9820f9fb23d7678 /src/dotty/tools/dotc | |
parent | 6ca5b9d4675c20002ca65dab3cacf32caade3933 (diff) | |
parent | 7668729bec9cad6977d1f5efb6ffd0035e56ff09 (diff) | |
download | dotty-bef40b45f6c15bf55fa73ea7923cb4da74cf77d0.tar.gz dotty-bef40b45f6c15bf55fa73ea7923cb4da74cf77d0.tar.bz2 dotty-bef40b45f6c15bf55fa73ea7923cb4da74cf77d0.zip |
Merge pull request #1383 from kcsongor/master
Fix 1375: Infinite loop in interpreter
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r-- | src/dotty/tools/dotc/printing/SyntaxHighlighting.scala | 13 |
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 '=' => |