aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-19 10:43:26 +0200
committerGitHub <noreply@github.com>2017-04-19 10:43:26 +0200
commit2efb6dd13fd4600d991cf8efe186e860c8cbadc6 (patch)
tree6cd760652f1534512388f7203ab8b0c2369c1398
parent6a0c581d24581cee19dd5448b1d6821f0538f0ca (diff)
parent2534faa8b5c94b37e59e4601c3bf67b7adcb5f18 (diff)
downloaddotty-2efb6dd13fd4600d991cf8efe186e860c8cbadc6.tar.gz
dotty-2efb6dd13fd4600d991cf8efe186e860c8cbadc6.tar.bz2
dotty-2efb6dd13fd4600d991cf8efe186e860c8cbadc6.zip
Merge pull request #2270 from dotty-staging/topic/enum-repl-parser
Make sure basic enums work with REPL
-rw-r--r--compiler/src/dotty/tools/dotc/parsing/Parsers.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
index 3112be659..9f393df00 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()
}
diff --git a/compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala b/compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
index e20f846ac..87ce31ad9 100644
--- a/compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
+++ b/compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
@@ -31,7 +31,7 @@ object SyntaxHighlighting {
private val tripleQs = Console.RED_B + "???" + NoColor
private val keywords: Seq[String] = for {
- index <- IF to INLINE // All alpha keywords
+ index <- IF to ENUM // All alpha keywords
} yield tokenString(index)
private val interpolationPrefixes =