diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2006-01-20 15:16:02 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2006-01-20 15:16:02 +0000 |
commit | 6fc1fe1d66829d2dbde21adf5955ab6bf21d2bd8 (patch) | |
tree | 1dfdc54d53c590c7fc05443fa8766d67312e2fd2 /src/library | |
parent | 628f5c1eab1f460e0ac1281b3e156e234ce5cb77 (diff) | |
download | scala-6fc1fe1d66829d2dbde21adf5955ab6bf21d2bd8.tar.gz scala-6fc1fe1d66829d2dbde21adf5955ab6bf21d2bd8.tar.bz2 scala-6fc1fe1d66829d2dbde21adf5955ab6bf21d2bd8.zip |
Improved TypedCode to support yet more code.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/reflect/Code.scala | 3 | ||||
-rw-r--r-- | src/library/scala/reflect/Print.scala | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/library/scala/reflect/Code.scala b/src/library/scala/reflect/Code.scala index 6632643160..83aa81d03d 100644 --- a/src/library/scala/reflect/Code.scala +++ b/src/library/scala/reflect/Code.scala @@ -19,4 +19,5 @@ case class Apply(fun: Code, args: List[Code]) extends Code; case class TypeApply(fun: Code, args: List[Type]) extends Code; case class Function(params: List[Symbol], body: Code) extends Code; case class This(sym: Symbol) extends Code; -case class Block(stats: List[Code], expr: Code) extends Code;
\ No newline at end of file +case class Block(stats: List[Code], expr: Code) extends Code; +case class New(sym: Code) extends Code;
\ No newline at end of file diff --git a/src/library/scala/reflect/Print.scala b/src/library/scala/reflect/Print.scala index e6995bc167..5d4cf45f62 100644 --- a/src/library/scala/reflect/Print.scala +++ b/src/library/scala/reflect/Print.scala @@ -36,6 +36,7 @@ object Print extends Function1[Any, String] { case reflect.Function(params, body) => "(" + params.map(Print).mkString("(", ", ", ")") + " => " + Print(body) + ")" case reflect.This(sym) => "(" + Print(sym) + ".this)" case reflect.Block(stats, expr) => (stats ::: List(expr)).map(Print).mkString("{", ";\n", "}") + case reflect.New(clazz) => "(new " + Print(clazz) + ")" case _ => "???" } |