Skip to content

Instantly share code, notes, and snippets.

@johannegger
Created June 3, 2015 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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