All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.async.internal.AsyncMacro.scala Maven / Gradle / Ivy

Go to download

An asynchronous programming facility for Scala that offers a direct API for working with Futures.

There is a newer version: 0.9.7
Show newest version
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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy