Last active
December 13, 2015 23:49
-
-
Save ochafik/4994400 to your computer and use it in GitHub Desktop.
Macro Extensions Plugin Input / Output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@scalaxy.extension[Any] | |
def quoted(quote: String) = quote + self + quote |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Transformed AST after the `scalaxy-extensions` compilation phase: | |
import scala.language.experimental.macros | |
implicit class scalaxy$extensions$quoted$1(self: Any) { | |
def quoted(quote$Expr$1: String) = macro scalaxy$extensions$quoted$1.quoted | |
} | |
object scalaxy$extensions$quoted$1 { | |
def quoted(c: scala.reflect.macros.Context) | |
(quote$Expr$1: c.Expr[String]): c.Expr[String] = { | |
import c.universe._ | |
val Apply(_, List(selfTree$1)) = c.prefix.tree | |
val self$Expr$1 = c.Expr[Any](selfTree$1) | |
reify({ | |
val self = self$Expr$1.splice | |
val quote = quote$Expr$1.splice | |
quote + self + quote | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment