scala.async.internal.AsyncMacro.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-async_2.11 Show documentation
Show all versions of scala-async_2.11 Show documentation
An asynchronous programming facility for Scala that offers a direct API for working with Futures.
package scala.async.internal
object AsyncMacro {
def apply(c0: reflect.macros.Context, base: AsyncBase): AsyncMacro { val c: c0.type } = {
import language.reflectiveCalls
new AsyncMacro { self =>
val c: c0.type = c0
// This member is required by `AsyncTransform`:
val asyncBase: AsyncBase = base
// These members are required by `ExprBuilder`:
val futureSystem: FutureSystem = base.futureSystem
val futureSystemOps: futureSystem.Ops {val c: self.c.type} = futureSystem.mkOps(c)
}
}
}
private[async] trait AsyncMacro
extends AnfTransform with TransformUtils with Lifter
with ExprBuilder with AsyncTransform with AsyncAnalysis with LiveVariables {
val c: scala.reflect.macros.Context
lazy val macroPos = c.macroApplication.pos.makeTransparent
def atMacroPos(t: c.Tree) = c.universe.atPos(macroPos)(t)
}