Skip to content

Commit c165dd2

Browse files
committed
Rename quoted.Runner to quoted.Toolbox
1 parent ad01d69 commit c165dd2

25 files changed

+32
-32
lines changed

compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.quoted.Expr
1111

1212
import java.net.URLClassLoader
1313

14-
import Runners.{Settings, Run, Show}
14+
import Toolbox.{Settings, Run, Show}
1515

1616
class QuoteDriver extends Driver {
1717
import tpd._

compiler/src/dotty/tools/dotc/quoted/Runners.scala renamed to compiler/src/dotty/tools/dotc/quoted/Toolbox.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ import scala.quoted.Exprs.ValueExpr
1111
import scala.runtime.quoted._
1212

1313
/** Default runners for quoted expressions */
14-
object Runners {
14+
object Toolbox {
1515
import tpd._
1616

1717
type Run
1818
type Show
1919

20-
implicit def runner[T]: Runner[T] = new Runner[T] {
20+
implicit def toolbox[T]: Toolbox[T] = new Toolbox[T] {
2121

22-
def run(expr: Expr[T]): T = Runners.run(expr, Settings.run())
22+
def run(expr: Expr[T]): T = Toolbox.run(expr, Settings.run())
2323

24-
def show(expr: Expr[T]): String = Runners.show(expr, Settings.show())
24+
def show(expr: Expr[T]): String = Toolbox.show(expr, Settings.show())
2525

2626
def toConstantOpt(expr: Expr[T]): Option[T] = {
2727
def toConstantOpt(tree: Tree): Option[T] = tree match {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala.quoted
22

3-
import scala.runtime.quoted.Runner
3+
import scala.runtime.quoted.Toolbox
44

55
object Constant {
6-
def unapply[T](expr: Expr[T])(implicit runner: Runner[T]): Option[T] = runner.toConstantOpt(expr)
6+
def unapply[T](expr: Expr[T])(implicit runner: Toolbox[T]): Option[T] = runner.toConstantOpt(expr)
77
}

library/src/scala/quoted/Expr.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package scala.quoted
22

3-
import scala.runtime.quoted.Runner
3+
import scala.runtime.quoted.Toolbox
44
import scala.runtime.quoted.Unpickler.Pickled
55

66
sealed abstract class Expr[T] {
77
final def unary_~ : T = throw new Error("~ should have been compiled away")
8-
final def run(implicit runner: Runner[T]): T = runner.run(this)
9-
final def show(implicit runner: Runner[T]): String = runner.show(this)
8+
final def run(implicit toolbox: Toolbox[T]): T = toolbox.run(this)
9+
final def show(implicit toolbox: Toolbox[T]): String = toolbox.show(this)
1010
}
1111

1212
object Expr {

library/src/scala/runtime/quoted/Runner.scala renamed to library/src/scala/runtime/quoted/Toolbox.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package scala.runtime.quoted
33
import scala.annotation.implicitNotFound
44
import scala.quoted.Expr
55

6-
@implicitNotFound("Could not find implicit Runner. Default runner can be imported with `import dotty.tools.dotc.quoted.Runners._`")
7-
trait Runner[T] {
6+
@implicitNotFound("Could not find implicit Toolbox. Default runner can be imported with `import dotty.tools.dotc.quoted.Toolbox._`")
7+
trait Toolbox[T] {
88
def run(expr: Expr[T]): T
99
def show(expr: Expr[T]): String
1010
def toConstantOpt(expr: Expr[T]): Option[T]

tests/pending/run-with-compiler/quote-run-constants-extract.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.quoted._
22

3-
import dotty.tools.dotc.quoted.Runners._
3+
import dotty.tools.dotc.quoted.Toolbox._
44

55
object Test {
66

tests/pending/run-with-compiler/quote-run-large.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22

33
import scala.quoted.TastyExpr
44

tests/pos/quote-0.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scala.quoted._
2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
class Test {
55

tests/pos/quote-assert/quoted_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners.runner
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
import Macros._
44

tests/run-with-compiler/i3823-b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3823-c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3823.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3876-b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3876-c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3876-d.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3876.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/i3946.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotty.tools.dotc.quoted.Runners._
1+
import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {

tests/run-with-compiler/quote-lib.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import scala.quoted._
3-
import dotty.tools.dotc.quoted.Runners._
3+
import dotty.tools.dotc.quoted.Toolbox._
44

55
import liftable.Units._
66
import liftable.Lets._

tests/run-with-compiler/quote-run-2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
import scala.quoted._
55

tests/run-with-compiler/quote-run-b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
import scala.quoted._
55

tests/run-with-compiler/quote-run-c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
import scala.quoted._
55

tests/run-with-compiler/quote-run-constants.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
import scala.quoted._
55

tests/run-with-compiler/quote-run-staged-interpreter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scala.quoted._
2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
enum Exp {
55
case Num(n: Int)

tests/run-with-compiler/quote-run-with-settings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import java.nio.file.{Files, Paths}
33

4-
import dotty.tools.dotc.quoted.Runners._
4+
import dotty.tools.dotc.quoted.Toolbox._
55

66
import scala.quoted._
77

tests/run-with-compiler/quote-run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import dotty.tools.dotc.quoted.Runners._
2+
import dotty.tools.dotc.quoted.Toolbox._
33

44
import scala.quoted._
55

0 commit comments

Comments
 (0)