summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/Eval.scala
blob: 6a59cbb6bf7de8bfd7f5bd370862a15e542f8ca8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* NSC -- new Scala compiler
 * Copyright 2005-2011 LAMP/EPFL
 * @author  Paul Phillips
 */

package scala.tools.nsc
package interpreter

trait Eval {
  /** Executes code looking for an implicit conversion from the type
   *  of the given identifier to CompletionAware.
   */
  // def completionAwareImplicit[T](id: String) = {
  //   val f1string = "%s => %s".format(typeForIdent(id).get, classOf[CompletionAware].getName)
  //   val code = """{
  //     |  def f(implicit x: (%s) = null): %s = x
  //     |  val f1 = f
  //     |  if (f1 == null) None else Some(f1(%s))
  //     |}""".stripMargin.format(f1string, f1string, id)
  //
  //   evalExpr[Option[CompletionAware]](code)
  // }

  // Coming soon
  // implicit def string2liftedcode(s: String): LiftedCode = new LiftedCode(s)
  // case class LiftedCode(code: String) {
  //   val lifted: String = {
  //     beQuietDuring { interpret(code) }
  //     eval2[String]("({ " + code + " }).toString")
  //   }
  //   def >> : String = lifted
  // }
}