diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-02-14 16:42:22 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-15 13:05:57 +0100 |
commit | 2216c68fcc104c3a9a40fcbec8b0654f5f2bb6c2 (patch) | |
tree | 31db3ba4fb3e0dae62bade80844a176b5ad76d01 /src | |
parent | 38a85e7196c843d43fd61203c06903bc0cb53a46 (diff) | |
download | scala-async-2216c68fcc104c3a9a40fcbec8b0654f5f2bb6c2.tar.gz scala-async-2216c68fcc104c3a9a40fcbec8b0654f5f2bb6c2.tar.bz2 scala-async-2216c68fcc104c3a9a40fcbec8b0654f5f2bb6c2.zip |
removes logic that branches on forInteractive
Diffstat (limited to 'src')
-rw-r--r-- | src/main/scala/scala/async/internal/AsyncBase.scala | 17 | ||||
-rw-r--r-- | src/main/scala/scala/async/internal/AsyncMacro.scala | 17 |
2 files changed, 4 insertions, 30 deletions
diff --git a/src/main/scala/scala/async/internal/AsyncBase.scala b/src/main/scala/scala/async/internal/AsyncBase.scala index c9cd101..537385f 100644 --- a/src/main/scala/scala/async/internal/AsyncBase.scala +++ b/src/main/scala/scala/async/internal/AsyncBase.scala @@ -46,24 +46,15 @@ abstract class AsyncBase { import compat._ val asyncMacro = AsyncMacro(c, self) - val isPresentationCompiler = asyncMacro.global.forInteractive - val code = asyncMacro.asyncTransform[T]( body.tree.asInstanceOf[asyncMacro.global.Tree], execContext.tree.asInstanceOf[asyncMacro.global.Tree] )(implicitly[c.WeakTypeTag[T]].asInstanceOf[asyncMacro.global.WeakTypeTag[T]]).asInstanceOf[Tree] - AsyncUtils.vprintln(s"async state machine transform expands to:\n ${code}") - val result = if (isPresentationCompiler) { - asyncMacro.suppressExpansion() - c.macroApplication - } else { - // Mark range positions for synthetic code as transparent to allow some wiggle room for overlapping ranges - for (t <- code) - t.pos = t.pos.makeTransparent - code - } - c.Expr[futureSystem.Fut[T]](result) + + // Mark range positions for synthetic code as transparent to allow some wiggle room for overlapping ranges + for (t <- code) t.pos = t.pos.makeTransparent + c.Expr[futureSystem.Fut[T]](code) } protected[async] def awaitMethod(u: Universe)(asyncMacroSymbol: u.Symbol): u.Symbol = { diff --git a/src/main/scala/scala/async/internal/AsyncMacro.scala b/src/main/scala/scala/async/internal/AsyncMacro.scala index e3400b4..b5a9645 100644 --- a/src/main/scala/scala/async/internal/AsyncMacro.scala +++ b/src/main/scala/scala/async/internal/AsyncMacro.scala @@ -31,21 +31,4 @@ private[async] trait AsyncMacro lazy val macroPos = macroApplication.pos.makeTransparent def atMacroPos(t: global.Tree) = global.atPos(macroPos)(t) - - def suppressExpansion() { - // Have your cake : Scala IDE sees original trees and hyperlinking, etc within async blocks "Just Works" - // Eat it too : (domain specific errors like "unsupported use of await" - // - // TODO remove this once we unsupport 2.10.x, scalac 2.11 does this automatically. - - import global.Tree - type Suppress = { def suppressMacroExpansion(a: Tree): Tree } - try { - global.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication) - } catch { - case _: NoSuchMethodException => - global.analyzer.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication) - } - } - } |