diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/ModelFrames.scala | 15 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/ModelToXML.scala | 24 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 12 |
3 files changed, 25 insertions, 26 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/ModelFrames.scala b/src/compiler/scala/tools/nsc/doc/ModelFrames.scala index 5e84513075..049b70579e 100644 --- a/src/compiler/scala/tools/nsc/doc/ModelFrames.scala +++ b/src/compiler/scala/tools/nsc/doc/ModelFrames.scala @@ -101,8 +101,6 @@ trait ModelFrames extends ModelExtractor { urlFor0(sym, sym) + FILE_EXTENSION_HTML case sym if !hasLink(sym) => null - case sym if sym.hasFlag(Flags.JAVA) => - null // handled in ModelToXML.link case msym: ModuleSymbol => urlFor0(sym, sym) + FILE_EXTENSION_HTML case csym: ClassSymbol => @@ -275,8 +273,6 @@ trait ModelFrames extends ModelExtractor { </table>; private def header0: NodeSeq = { val owner = decode(clazz.sym.owner) - val name = - owner.fullNameString('/') + (if (owner.isPackage) "/" + clazz.name else "") <xml:group> <div class="entity"> {aref(urlFor(owner), "_self", owner.fullNameString('.'))} @@ -284,7 +280,16 @@ trait ModelFrames extends ModelExtractor { <span class="entity">{Text(clazz.kind)} {Text(clazz.name)}</span> </div><hr/> <div style="font-size:smaller; color:gray;"> - [source: <a class={name} href=""><code>{name + ".scala"}</code></a>] + { + if (global.definitions.SyntheticClasses contains clazz.sym) + Text("[Source: none]") + else { + val name = owner.fullNameString('/') + (if (owner.isPackage) "/" + clazz.name else "") + Text("[source: ") ++ + <a class={name} href=""><code>{name + ".scala"}</code></a> ++ + Text("]") + } + } </div><hr/> </xml:group> } diff --git a/src/compiler/scala/tools/nsc/doc/ModelToXML.scala b/src/compiler/scala/tools/nsc/doc/ModelToXML.scala index 3561d314cd..3b39bc9a85 100644 --- a/src/compiler/scala/tools/nsc/doc/ModelToXML.scala +++ b/src/compiler/scala/tools/nsc/doc/ModelToXML.scala @@ -26,22 +26,9 @@ trait ModelToXML extends ModelExtractor { def link(entity: Symbol)(implicit frame: Frame): NodeSeq = { val url = urlFor(entity) // nothing to do but be verbose. - if (url == null) { - val name = entity.owner.fullNameString('.') + '.' + entity.nameString - if (entity.hasFlag(symtab.Flags.JAVA)) { - def sig(sym: Symbol): String = - sym.nameString + "(" + (sym.tpe match { - case MethodType(pt, _) => pt.mkString(", ") - case _ => "" - }) + ")" - val ownerName = entity.owner.fullNameString('/') - val (name0, anchor) = - if (entity.isMethod) (ownerName, "#" + sig(entity)) - else (ownerName + "/" + entity.nameString, "") - <a class={name0} href={anchor} target="contentFrame">{name}</a> - } else - Text(name) - } else + if (url == null) + Text(entity.owner.fullNameString('.') + '.' + entity.nameString) + else aref(url, entity.nameString) } @@ -69,9 +56,8 @@ trait ModelToXML extends ModelExtractor { (parents.head.symbol eq definitions.ObjectClass)) parents.tail; else parents; parents1.mkXML(Text(""), <code> with </code>, Text(""))(link); - case _ => { - link(decode(tpe.symbol)); - } + case _ => + link(decode(tpe.symbol)) } } diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 8f51b294dc..b52b4fbdca 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -49,6 +49,7 @@ trait Definitions { // Symbol -> (Symbol, Type): scalaCaller -> (scalaMethodSym, DelegateType) // var Delegate_scalaCallerInfos: HashMap[Symbol, (Symbol, Type)] = _ var Delegate_scalaCallerTargets: HashMap[Symbol, Symbol] = _ + var SyntheticClasses: HashSet[Symbol] = _ // the scala value classes var UnitClass: Symbol = _ @@ -775,7 +776,7 @@ trait Definitions { private var isInitialized = false - def init: unit = { + def init { if (isInitialized) return isInitialized = true RootClass = @@ -1002,6 +1003,13 @@ trait Definitions { SerializableAttr = getClass("scala.serializable") BeanPropertyAttr = if (forCLDC || forMSIL) null else getClass("scala.reflect.BeanProperty") DeprecatedAttr = getClass("scala.deprecated") + + SyntheticClasses = new HashSet[Symbol] + SyntheticClasses ++= List( + AllClass, AllRefClass, AnyClass, AnyRefClass, AnyValClass, + //value classes + BooleanClass, ByteClass, CharClass, DoubleClass, FloatClass, + IntClass, LongClass, ShortClass, UnitClass) } var nbScalaCallers: Int = 0 @@ -1017,7 +1025,7 @@ trait Definitions { // val newCaller = newPolyMethod(DelegateClass, name, // tparam => MethodType(paramTypes, tparam.typeConstructor)) setFlag (FINAL | STATIC) Delegate_scalaCallers = Delegate_scalaCallers ::: List(newCaller) - nbScalaCallers = nbScalaCallers + 1 + nbScalaCallers += 1 newCaller } |