Created
September 11, 2012 18:36
-
-
Save jsuereth/3700672 to your computer and use it in GitHub Desktop.
Parse a string to a tree
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
| scala> import reflect.runtime.currentMirror | |
| import reflect.runtime.currentMirror | |
| scala> import scala.tools.reflect.ToolBox | |
| import scala.tools.reflect.ToolBox | |
| scala> currentMirror.mkToolBox() | |
| res5: scala.tools.reflect.ToolBox[reflect.runtime.universe.type] = scala.tools.reflect.ToolBoxFactory$ToolBoxImpl@2288e718 | |
| scala> res5.parseExpr("def x = 'c'") | |
| res6: res5.u.Tree = def x = 'c' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment