Created
April 15, 2017 13:38
-
-
Save virtualsafety/bf07e765eac2af6a5c18e955ff822b57 to your computer and use it in GitHub Desktop.
查看 Scala 语法树的方法
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
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)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://docs.scala-lang.org/overviews/reflection/overview.html