Skip to content

Commit 2efb6dd

Browse files
authored
Merge pull request #2270 from dotty-staging/topic/enum-repl-parser
Make sure basic enums work with REPL
2 parents 6a0c581 + 2534faa commit 2efb6dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ object Parsers {
21512151
/** EnumCaseStats = EnumCaseStat {semi EnumCaseStat */
21522152
def enumCaseStats(): List[DefTree] = {
21532153
val cases = new ListBuffer[DefTree] += enumCaseStat()
2154-
while (in.token != RBRACE) {
2154+
while (in.token != RBRACE && in.token != EOF) {
21552155
acceptStatSep()
21562156
cases += enumCaseStat()
21572157
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object SyntaxHighlighting {
3131
private val tripleQs = Console.RED_B + "???" + NoColor
3232

3333
private val keywords: Seq[String] = for {
34-
index <- IF to INLINE // All alpha keywords
34+
index <- IF to ENUM // All alpha keywords
3535
} yield tokenString(index)
3636

3737
private val interpolationPrefixes =

0 commit comments

Comments
 (0)