Skip to content

Instantly share code, notes, and snippets.

@virtualsafety
Created April 15, 2017 13:38
Show Gist options
  • Save virtualsafety/bf07e765eac2af6a5c18e955ff822b57 to your computer and use it in GitHub Desktop.
Save virtualsafety/bf07e765eac2af6a5c18e955ff822b57 to your computer and use it in GitHub Desktop.
查看 Scala 语法树的方法
import scala.reflect.runtime._
import scala.tools.reflect.ToolBox
val cm = universe.runtimeMirror(getClass.getClassLoader)
val tb = cm.mkToolBox()
tb.parse("for(i <- List(1,2,3) ) {println(i)}")
@virtualsafety
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment