~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* NSC -- new Scala compiler
2
 
 * Copyright 2005-2011 LAMP/EPFL
 
2
 * Copyright 2005-2013 LAMP/EPFL
3
3
 * @author  Martin Odersky
4
4
 */
5
5
 
6
6
package scala.tools.nsc
7
7
package symtab
8
8
 
 
9
import scala.reflect.internal.util.BatchSourceFile
9
10
import scala.tools.nsc.io.AbstractFile
10
 
import scala.tools.nsc.util.BatchSourceFile
11
11
 
12
12
/** A subclass of SymbolLoaders that implements browsing behavior.
13
13
 *  This class should be used whenever file dependencies and recompile sets
64
64
          addPackagePrefix(pre)
65
65
          packagePrefix += ("." + name)
66
66
        case Ident(name) =>
67
 
          if (packagePrefix.length != 0) packagePrefix += "."
68
 
          packagePrefix += name
 
67
          if (name != nme.EMPTY_PACKAGE_NAME) { // mirrors logic in Namers, see createPackageSymbol
 
68
            if (packagePrefix.length != 0) packagePrefix += "."
 
69
            packagePrefix += name
 
70
          }
69
71
        case _ =>
70
72
          throw new MalformedInput(pkg.pos.point, "illegal tree node in package prefix: "+pkg)
71
73
      }
 
74
 
 
75
      private def inPackagePrefix(pkg: Tree)(op: => Unit): Unit = {
 
76
        val oldPrefix = packagePrefix
 
77
        addPackagePrefix(pkg)
 
78
        op
 
79
        packagePrefix = oldPrefix
 
80
      }
 
81
 
72
82
      override def traverse(tree: Tree): Unit = tree match {
73
83
        case PackageDef(pkg, body) =>
74
 
          addPackagePrefix(pkg)
75
 
          body foreach traverse
 
84
          inPackagePrefix(pkg) { body foreach traverse }
 
85
 
76
86
        case ClassDef(_, name, _, _) =>
77
87
          if (packagePrefix == root.fullName) {
78
88
            enterClass(root, name.toString, new SourcefileLoader(src))
84
94
            entered += 1
85
95
            if (name == nme.PACKAGEkw) {
86
96
              println("open package module: "+module)
87
 
              loaders.openPackageModule(module)()
 
97
              openPackageModule(module, root)
88
98
            }
89
99
          } else println("prefixes differ: "+packagePrefix+","+root.fullName)
90
100
        case _ =>
105
115
   */
106
116
  override def enterToplevelsFromSource(root: Symbol, name: String, src: AbstractFile) {
107
117
    try {
108
 
      if (root == definitions.RootClass || root == definitions.EmptyPackageClass)
 
118
      if (root.isEffectiveRoot || !src.name.endsWith(".scala")) // RootClass or EmptyPackageClass
109
119
        super.enterToplevelsFromSource(root, name, src)
110
120
      else
111
121
        browseTopLevel(root, src)