Skip to content

Commit 2a91054

Browse files
committed
Renamings
1 parent c22eb4b commit 2a91054

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dotty.tools.dotc.quoted
33
import dotty.tools.dotc.CompilationUnit
44
import dotty.tools.dotc.util.NoSource
55

6-
import scala.quoted.Expr
6+
import scala.quoted._
77

88
/* Compilation unit containing the contents of a quoted expression */
9-
class ExprCompilationUnit(val expr: scala.quoted.QuoteContext => Expr[_]) extends CompilationUnit(NoSource)
9+
class ExprCompilationUnit(val exprBuilder: QuoteContext => Expr[_]) extends CompilationUnit(NoSource)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class QuoteCompiler extends Compiler {
5050
units.map {
5151
case exprUnit: ExprCompilationUnit =>
5252
val tree =
53-
if (putInClass) inClass(exprUnit.expr)
54-
else PickledQuotes.quotedExprToTree(checkValidRunExpr(exprUnit.expr.apply(new QuoteContext(ReflectionImpl(ctx)))))
53+
if (putInClass) inClass(exprUnit.exprBuilder)
54+
else PickledQuotes.quotedExprToTree(checkValidRunExpr(exprUnit.exprBuilder.apply(new QuoteContext(ReflectionImpl(ctx)))))
5555
val source = SourceFile.virtual("<quoted.Expr>", "")
5656
CompilationUnit(source, tree, forceTrees = true)
5757
}
@@ -67,7 +67,7 @@ class QuoteCompiler extends Compiler {
6767
* with the following format.
6868
* `package __root__ { class ' { def apply: Any = <expr> } }`
6969
*/
70-
private def inClass(expr: scala.quoted.QuoteContext => Expr[_])(implicit ctx: Context): Tree = {
70+
private def inClass(exprBuilder: QuoteContext => Expr[_])(implicit ctx: Context): Tree = {
7171
val pos = Span(0)
7272
val assocFile = new VirtualFile("<quote>")
7373

@@ -76,7 +76,7 @@ class QuoteCompiler extends Compiler {
7676
cls.enter(ctx.newDefaultConstructor(cls), EmptyScope)
7777
val meth = ctx.newSymbol(cls, nme.apply, Method, ExprType(defn.AnyType), coord = pos).entered
7878

79-
val quoted = PickledQuotes.quotedExprToTree(checkValidRunExpr(expr.apply(new QuoteContext(ReflectionImpl(ctx)))))(ctx.withOwner(meth))
79+
val quoted = PickledQuotes.quotedExprToTree(checkValidRunExpr(exprBuilder.apply(new QuoteContext(ReflectionImpl(ctx)))))(ctx.withOwner(meth))
8080

8181
val run = DefDef(meth, quoted)
8282
val classTree = ClassDef(cls, DefDef(cls.primaryConstructor.asTerm), run :: Nil)
@@ -87,8 +87,8 @@ class QuoteCompiler extends Compiler {
8787
}
8888

8989
class ExprRun(comp: Compiler, ictx: Context) extends Run(comp, ictx) {
90-
def compileExpr(expr: scala.quoted.QuoteContext => Expr[_]): Unit = {
91-
val units = new ExprCompilationUnit(expr) :: Nil
90+
def compileExpr(exprBuilder: QuoteContext => Expr[_]): Unit = {
91+
val units = new ExprCompilationUnit(exprBuilder) :: Nil
9292
compileUnits(units)
9393
}
9494
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import dotty.tools.dotc.tastyreflect.ReflectionImpl
77
import dotty.tools.io.{AbstractFile, Directory, PlainDirectory, VirtualDirectory}
88
import dotty.tools.repl.AbstractFileClassLoader
99
import dotty.tools.dotc.reporting._
10-
import scala.quoted.{Expr, Type}
10+
import scala.quoted._
1111
import scala.quoted.Toolbox
1212
import java.net.URLClassLoader
1313

@@ -20,7 +20,7 @@ class QuoteDriver(appClassloader: ClassLoader) extends Driver {
2020

2121
private[this] val contextBase: ContextBase = new ContextBase
2222

23-
def run[T](expr: scala.quoted.QuoteContext => Expr[T], settings: Toolbox.Settings): T = {
23+
def run[T](exprBuilder: QuoteContext => Expr[T], settings: Toolbox.Settings): T = {
2424
val outDir: AbstractFile = settings.outDir match {
2525
case Some(out) =>
2626
val dir = Directory(out)
@@ -34,7 +34,7 @@ class QuoteDriver(appClassloader: ClassLoader) extends Driver {
3434
val ctx = setToolboxSettings(ctx0.fresh.setSetting(ctx0.settings.outputDir, outDir), settings)
3535

3636
val driver = new QuoteCompiler
37-
driver.newRun(ctx).compileExpr(expr)
37+
driver.newRun(ctx).compileExpr(exprBuilder)
3838

3939
assert(!ctx.reporter.hasErrors)
4040

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
package dotty.tools.dotc.quoted
22

3-
import dotty.tools.dotc.ast.tpd
4-
53
import scala.quoted._
6-
import scala.internal.quoted.{LiftedExpr, TastyTreeExpr}
74

85
/** Default runners for quoted expressions */
96
object ToolboxImpl {
10-
import tpd._
117

128
/** Create a new instance of the toolbox using the the classloader of the application.
139
*
@@ -19,8 +15,8 @@ object ToolboxImpl {
1915

2016
private[this] val driver: QuoteDriver = new QuoteDriver(appClassloader)
2117

22-
def run[T](expr: scala.quoted.QuoteContext => Expr[T]): T = synchronized {
23-
driver.run(expr, settings)
18+
def run[T](exprBuilder: QuoteContext => Expr[T]): T = synchronized {
19+
driver.run(exprBuilder, settings)
2420
}
2521

2622
}

0 commit comments

Comments
 (0)