aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-17 16:40:22 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-17 16:40:22 +0200
commit2534faa8b5c94b37e59e4601c3bf67b7adcb5f18 (patch)
treeafd4bd6366138cccb3625efd5d482a3a1a1cb929
parent2627c1005d32a14ab487e72514997c5664350fc7 (diff)
downloaddotty-2534faa8b5c94b37e59e4601c3bf67b7adcb5f18.zip
dotty-2534faa8b5c94b37e59e4601c3bf67b7adcb5f18.tar.gz
dotty-2534faa8b5c94b37e59e4601c3bf67b7adcb5f18.tar.bz2
Fix infinite loop in parser when parsing enums
-rw-r--r--compiler/src/dotty/tools/dotc/parsing/Parsers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
index 3112be6..9f393df 100644
--- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
+++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -2151,7 +2151,7 @@ object Parsers {
/** EnumCaseStats = EnumCaseStat {semi EnumCaseStat */
def enumCaseStats(): List[DefTree] = {
val cases = new ListBuffer[DefTree] += enumCaseStat()
- while (in.token != RBRACE) {
+ while (in.token != RBRACE && in.token != EOF) {
acceptStatSep()
cases += enumCaseStat()
}