Skip to content

Instantly share code, notes, and snippets.

@johannegger
Created June 3, 2015 14:58
Show Gist options
  • Save johannegger/ecc4c5a89f9363764046 to your computer and use it in GitHub Desktop.
Save johannegger/ecc4c5a89f9363764046 to your computer and use it in GitHub Desktop.
import scala.reflect.runtime.universe._
import scala.tools.reflect.{ToolBox, ToolBoxError}
val toolbox = runtimeMirror(getClass.getClassLoader).mkToolBox()
val source = "class Foo"
val tree = toolbox.parse(source)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment