summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-04-19 02:49:25 +0000
committerLex Spoon <lex@lexspoon.org>2007-04-19 02:49:25 +0000
commit81cc9a834ceacb02fa7ec933708f6513248becd7 (patch)
tree547121a4a5d7749759e85c182c0fcb6c8d7eb9c1
parentea0c3a7ce9666904ab208ab0d87724b8d5749fe3 (diff)
downloadscala-81cc9a834ceacb02fa7ec933708f6513248becd7.tar.gz
scala-81cc9a834ceacb02fa7ec933708f6513248becd7.tar.bz2
scala-81cc9a834ceacb02fa7ec933708f6513248becd7.zip
use "trait" as the keyword for traits, not "class"
-rw-r--r--src/compiler/scala/tools/nsc/Interpreter.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala
index 80600fb7d3..a69ed3b394 100644
--- a/src/compiler/scala/tools/nsc/Interpreter.scala
+++ b/src/compiler/scala/tools/nsc/Interpreter.scala
@@ -800,7 +800,12 @@ class Interpreter(val settings: Settings, reporter: Reporter, out: PrintWriter)
case List(ClassDef(_, name, _, _, _)) => name
}
- def keyword = trees.head.asInstanceOf[ClassDef].keyword
+ def classdef = trees.head.asInstanceOf[ClassDef]
+
+ // TODO: MemberDef.keyword does not include "trait";
+ // otherwise it could be used here
+ def keyword: String =
+ if(classdef.mods.isTrait) "trait" else "class"
override def resultExtractionCode(code: PrintWriter): Unit = {
super.resultExtractionCode(code)
@@ -872,7 +877,7 @@ object Interpreter {
}
/** Heuristically strip interpreter wrapper prefixes
- * from an interpreter output string.
+ * from an interpreter output string.
*/
def stripWrapperGunk(str: String): String = {
val wrapregex = "line[0-9]+\\$object(\\$\\$iw)*"