summaryrefslogtreecommitdiff
path: root/sources/scalac/ast
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-04-02 07:32:39 +0000
committerMartin Odersky <odersky@gmail.com>2003-04-02 07:32:39 +0000
commitf115eda9c9bc97313591ca699e07fa2a117cc997 (patch)
treee9040aad58088217db6b3a4c950bd6c257c89cb5 /sources/scalac/ast
parentd8284d61f2f09a72f223c6e9396eec8fa5893d29 (diff)
downloadscala-f115eda9c9bc97313591ca699e07fa2a117cc997.tar.gz
scala-f115eda9c9bc97313591ca699e07fa2a117cc997.tar.bz2
scala-f115eda9c9bc97313591ca699e07fa2a117cc997.zip
*** empty log message ***
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r--sources/scalac/ast/TreeGen.java10
-rw-r--r--sources/scalac/ast/printer/TextTreePrinter.java5
2 files changed, 12 insertions, 3 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java
index 18275af3a7..864609e7f8 100644
--- a/sources/scalac/ast/TreeGen.java
+++ b/sources/scalac/ast/TreeGen.java
@@ -56,7 +56,7 @@ public class TreeGen implements Kinds, Modifiers {
/*************************************************************************/
/** METHODS **/
- private Type deref(Type tp) {
+ public Type deref(Type tp) {
switch (tp) {
case PolyType(Symbol[] tparams, Type restp):
if (tparams.length == 0) return restp;
@@ -160,7 +160,7 @@ public class TreeGen implements Kinds, Modifiers {
/** Build a boolean constant tree.
*/
- public Tree mkBoolean(int pos, boolean bool) {
+ public Tree mkBooleanLit(int pos, boolean bool) {
return make.Literal(pos, bool ? Boolean.TRUE : Boolean.FALSE).
setType(definitions.BOOLEAN_TYPE);
}
@@ -171,6 +171,12 @@ public class TreeGen implements Kinds, Modifiers {
return make.Literal(pos, str).setType(definitions.JAVA_STRING_TYPE);
}
+ /** Build an integer literal
+ */
+ public Tree mkIntLit(int pos, int value) {
+ return make.Literal(pos, new Integer(value)).setType(definitions.INT_TYPE);
+ }
+
/** Build a tree to be used as a base class constructor for a template.
*/
public Tree mkParentConstr(int pos, Type parentType) {
diff --git a/sources/scalac/ast/printer/TextTreePrinter.java b/sources/scalac/ast/printer/TextTreePrinter.java
index 0d4ff6022f..36401bcab1 100644
--- a/sources/scalac/ast/printer/TextTreePrinter.java
+++ b/sources/scalac/ast/printer/TextTreePrinter.java
@@ -427,7 +427,10 @@ public class TextTreePrinter implements TreePrinter {
break;
case Apply(Tree fun, Tree[] vargs):
- print(fun);
+ if (fun instanceof Tree.TypeTerm)
+ print(fun.type.resultType().symbol().fullName().toString());
+ else
+ print(fun);
printArray(vargs, TXT_LEFT_PAREN, TXT_RIGHT_PAREN, TXT_COMMA_SP);
printType(tree);
break;