Skip to content

Commit 32d3c5d

Browse files
committed
Inline repl project into dotty-compiler
As discussed with Guillaume Martres, this has the effect that if you depend on dotty-compiler version X, you also get the appropriate dotty repl with the same version
1 parent 3601214 commit 32d3c5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6
-17
lines changed

build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped`
1818
val `scala-library` = Build.`scala-library`
1919
val `scala-compiler` = Build.`scala-compiler`
2020
val `scala-reflect` = Build.`scala-reflect`
21-
val `dotty-repl` = Build.`dotty-repl`
2221
val scalap = Build.scalap
2322
val dist = Build.dist
2423
val `dist-bootstrapped` = Build.`dist-bootstrapped`

repl/src/dotty/tools/repl/ParseResult.scala renamed to compiler/src/dotty/tools/repl/ParseResult.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ case object Help extends Command {
9595

9696
object ParseResult {
9797

98-
private[this] val CommandExtract = """(:[\S]+)\s*(.*)""".r
98+
@sharable private[this] val CommandExtract = """(:[\S]+)\s*(.*)""".r
9999

100100
/** Extract a `ParseResult` from the string `sourceCode` */
101101
def apply(sourceCode: String)(implicit ctx: Context): ParseResult =

repl/src/dotty/tools/repl/UserFacingPrinter.scala renamed to compiler/src/dotty/tools/repl/UserFacingPrinter.scala

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import dotc.core.Symbols.{ Symbol, ClassSymbol, defn }
1717
import dotc.core.SymDenotations.NoDenotation
1818
import dotc.core.Types._
1919
import dotc.printing.Texts._
20-
import dotc.printing.{ GlobalPrec, DotPrec, Printer, PlainPrinter }
20+
import dotc.printing.{ GlobalPrec, DotPrec, Printer, PlainPrinter, RefinedPrinter }
2121
import dotc.typer.Implicits.SearchResult
2222
import dotc.typer.ImportInfo
2323

24-
class UserFacingPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
24+
class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
2525

2626
private def panic(msg: String): Nothing = throw new AssertionError(msg)
2727

@@ -75,15 +75,6 @@ class UserFacingPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
7575
}
7676
}
7777

78-
override def toText(denot: Denotation): Text = denot match {
79-
case NoDenotation =>
80-
panic("NoDenotation encountered in UserFacingPrinter")
81-
case denot: MultiDenotation =>
82-
panic("MultiDenotation not allowed in UserFacingPrinter")
83-
case _ =>
84-
toText(denot.symbol)
85-
}
86-
8778
override def toText(const: Constant): Text = Str(const.value.toString)
8879

8980
override def toText(tp: Type): Text = tp match {
@@ -142,7 +133,6 @@ class UserFacingPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
142133
printPkg(tp.cls.owner.asClass) ~ "." ~ nameString(tp.cls.name)
143134
}
144135
}
136+
case tp => super.toText(tp)
145137
}
146-
147-
override lazy val plain = new PlainPrinter(_ctx)
148138
}

0 commit comments

Comments
 (0)