Skip to content

Commit f4b89d7

Browse files
committed
.
1 parent b79e803 commit f4b89d7

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object SyntaxHighlighting {
2727
val CommentColor: String = Console.BLUE
2828
val KeywordColor: String = Console.YELLOW
2929
val ValDefColor: String = Console.CYAN
30-
val LiteralColor: String = Console.RED
30+
val LiteralColor: String = Console.GREEN
3131
val StringColor: String = Console.GREEN
3232
val TypeColor: String = Console.MAGENTA
3333
val AnnotationColor: String = Console.MAGENTA
@@ -80,6 +80,9 @@ object SyntaxHighlighting {
8080
case IDENTIFIER if name == nme.??? =>
8181
highlightRange(start, end, Console.RED_B)
8282

83+
case IDENTIFIER if name.head.isUpper =>
84+
highlightRange(start, end, TypeColor)
85+
8386
case _ =>
8487
}
8588
}

compiler/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ReplCompilerTests extends ReplTest:
7777
assertEquals(1, summon[State].imports.size)
7878
run("""mutable.Map("one" -> 1)""")
7979
assertEquals(
80-
"val res0: scala.collection.mutable.Map[String, Int] = Map(\"one\" -> 1)",
80+
"val res0: scala.collection.mutable.Map[String, Int] = HashMap(\"one\" -> 1)",
8181
storedOutput().trim
8282
)
8383
}
@@ -262,7 +262,7 @@ class ReplCompilerTests extends ReplTest:
262262

263263
@Test def testSingletonPrint = initially {
264264
run("""val a = "hello"; val x: a.type = a""")
265-
assertMultiLineEquals("val a: String = hello\nval x: a.type = \"hello\"", storedOutput().trim)
265+
assertMultiLineEquals("val a: String =\" hello\"\nval x: a.type = \"hello\"", storedOutput().trim)
266266
}
267267

268268
@Test def i6574 = initially {

staging/test-resources/repl-staging/i6007

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ def compiler: scala.quoted.staging.Compiler
55
scala> def v(using Quotes) = '{ (if true then Some(1) else None).map(v => v+1) }
66
def v(using x$1: scala.quoted.Quotes): scala.quoted.Expr[Option[Int]]
77
scala> scala.quoted.staging.withQuotes(v.show)
8-
val res0: String = (if (true) scala.Some.apply[scala.Int](1) else scala.None).map[scala.Int](((v: scala.Int) => v.+(1)))
8+
val res0: String = "(if (true) scala.Some.apply[scala.Int](1) else scala.None).map[scala.Int](((v: scala.Int) => v.+(1)))"
99
scala> scala.quoted.staging.run(v)
1010
val res1: Option[Int] = Some(2)

0 commit comments

Comments
 (0)