Scala macro that returns an empty AST -
I have created a simple macro that generates compiler warnings (or errors) if specified date FIXME (or TODO)) Date
Macro implementation () used for Scala 2.10.4 Returning generates the following, You might consider making the block defined for the macro as an argument : You can also consider macro annotations. c.Expr [Any] Return type, 2.11.0 is a whitebox macro that returns returns
c.Tree .
c.Expr [Any] (Amritree) or
EmptyTree respectively returns a value. The following greetings of the macro believe,
def hi () {FIXME ("2073/04/10: this has not been decided by 2073/04/10, then by canceling the collection Generates the following, println ("hello")}
def hi (): unit = {(& lt; blank & gt;: scala.runtime.BoxedUnit); Scala.this.Predef.println ("hi"}}; On the macro call site, it is possible to generate the following instead:
def hi (): unit = {scala.this.Predef.println ("hi")};
def hi = FIXME ("...") {compare the println (...)} compiler with elidable code: it is a "zero" value, empty tree is not.
Comments
Post a Comment