Skip to content

Commit

Permalink
switch to unnested packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Jul 24, 2009
1 parent 8a78d37 commit 40707e0
Show file tree
Hide file tree
Showing 497 changed files with 1,142 additions and 629 deletions.
2 changes: 1 addition & 1 deletion lib/scala-compiler.jar.desired.sha1
@@ -1 +1 @@
214753a2e3c36db0655f82d561f6021ab7334a76 ?scala-compiler.jar
3e2486ec3212ff87ab890bd351b1ecf91d316e01 ?scala-compiler.jar
2 changes: 1 addition & 1 deletion lib/scala-library.jar.desired.sha1
@@ -1 +1 @@
fa88b5b17a2ec189f5de7bac6e53f7438e88392e ?scala-library.jar
78395a28c554de8934411e42f99dbb23ff0dce44 ?scala-library.jar
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/FreshNameCreator.scala
Expand Up @@ -8,7 +8,8 @@

// $Id$

package scala.actors.remote
package scala.actors
package remote

object FreshNameCreator {

Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/JavaSerializer.scala
Expand Up @@ -8,7 +8,8 @@

// $Id$

package scala.actors.remote
package scala.actors
package remote

import java.io.{ByteArrayInputStream, ByteArrayOutputStream,
ObjectInputStream, ObjectOutputStream, InputStream,
Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/NetKernel.scala
Expand Up @@ -8,7 +8,8 @@

// $Id$

package scala.actors.remote
package scala.actors
package remote

import scala.collection.mutable.{HashMap, HashSet}

Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/Proxy.scala
Expand Up @@ -8,7 +8,8 @@

// $Id$

package scala.actors.remote
package scala.actors
package remote

import scala.collection.mutable.HashMap

Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/RemoteActor.scala
Expand Up @@ -9,7 +9,8 @@
// $Id$


package scala.actors.remote
package scala.actors
package remote


/** <p>
Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/Serializer.scala
Expand Up @@ -9,7 +9,8 @@
// $Id$


package scala.actors.remote
package scala.actors
package remote


import java.lang.ClassNotFoundException
Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/Service.scala
Expand Up @@ -8,7 +8,8 @@

// $Id$

package scala.actors.remote
package scala.actors
package remote

/**
* @version 0.9.10
Expand Down
3 changes: 2 additions & 1 deletion src/actors/scala/actors/remote/TcpService.scala
Expand Up @@ -9,7 +9,8 @@
// $Id$


package scala.actors.remote
package scala.actors
package remote


import java.io.{DataInputStream, DataOutputStream, IOException}
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/ant/FastScalac.scala
Expand Up @@ -93,7 +93,7 @@ class FastScalac extends Scalac {

val args = (cmdOptions ::: (sourceFiles map (_.toString))).toArray
try {
if(nsc.CompileClient.main0(args) > 0 && failonerror)
if (scala.tools.nsc.CompileClient.main0(args) > 0 && failonerror)
error("Compile failed; see the compiler error output for details.")
}
catch {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/Global.scala
Expand Up @@ -146,7 +146,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable

// ------------------ Reporting -------------------------------------

import nsc.util.NoPosition
import util.NoPosition
def error(msg: String) = reporter.error(NoPosition, msg)
def warning(msg: String) = reporter.warning(NoPosition, msg)
def inform(msg: String) = Console.err.println(msg)
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/Interpreter.scala
Expand Up @@ -23,8 +23,8 @@ import reporters.{ ConsoleReporter, Reporter }
import symtab.{ Flags, Names }
import util.{ SourceFile, BatchSourceFile, ClassPath }
import scala.util.NameTransformer
import nsc.{ InterpreterResults => IR }
import nsc.interpreter._
import scala.tools.nsc.{ InterpreterResults => IR }
import interpreter._
import Interpreter._

/** <p>
Expand Down
9 changes: 6 additions & 3 deletions src/compiler/scala/tools/nsc/ast/NodePrinters.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id$

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

import compat.Platform.EOL
import symtab.Flags._
Expand Down Expand Up @@ -317,8 +318,10 @@ abstract class NodePrinters {
traverse(tpt, level + 1, true)
traverse(rhs, level + 1, false)
printcln(")")
case PackageDef(name, stats) =>
println("PackageDef("+name+", ")
case PackageDef(pid, stats) =>
println("PackageDef(")
traverse(pid, level + 1, false)
println(",\n")
for (stat <- stats)
traverse(stat, level + 1, false)
printcln(")")
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id$

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

import java.awt.{List => awtList, _}
import java.awt.event._
Expand Down Expand Up @@ -412,7 +413,7 @@ abstract class TreeBrowsers {
mods.annotations ::: impl :: children
}

case PackageDef(name, stats) =>
case PackageDef(pid, stats) =>
stats

case ModuleDef(mods, name, impl) =>
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/scala/tools/nsc/ast/TreeDSL.scala
Expand Up @@ -4,7 +4,8 @@
* @author Paul Phillips
*/

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

/** A DSL for generating scala code. The goal is that the
* code generating code should look a lot like the code it
Expand Down Expand Up @@ -244,4 +245,4 @@ trait TreeDSL {
implicit def mkTreeFromSelectStart(ss: SelectStart): Select = ss.tree
implicit def mkTreeMethodsFromSelectStart(ss: SelectStart): TreeMethods = mkTreeMethods(ss.tree)
}
}
}
3 changes: 2 additions & 1 deletion src/compiler/scala/tools/nsc/ast/TreeGen.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id$

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

import scala.collection.mutable.ListBuffer
import symtab.Flags._
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/scala/tools/nsc/ast/TreeInfo.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id$

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

import symtab.Flags._
import symtab.SymbolTable
Expand Down Expand Up @@ -324,7 +325,7 @@ abstract class TreeInfo {
/** Compilation unit is the predef object
*/
def isPredefUnit(tree: Tree): Boolean = tree match {
case PackageDef(nme.scala_, List(obj)) => isPredefObj(obj)
case PackageDef(Ident(nme.scala_), List(obj)) => isPredefObj(obj)
case _ => false
}

Expand Down
3 changes: 2 additions & 1 deletion src/compiler/scala/tools/nsc/ast/TreePrinters.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id$

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

import compat.Platform.{EOL => LINE_SEPARATOR}
import java.io.{OutputStream, PrintWriter, Writer}
Expand Down
63 changes: 38 additions & 25 deletions src/compiler/scala/tools/nsc/ast/Trees.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id$

package scala.tools.nsc.ast
package scala.tools.nsc
package ast

import java.io.{PrintWriter, StringWriter}

Expand Down Expand Up @@ -273,6 +274,10 @@ trait Trees {
override var symbol: Symbol = NoSymbol
}

trait RefTree extends SymTree {
def name: Name
}

abstract class DefTree extends SymTree {
def name: Name
override def isDef = true
Expand Down Expand Up @@ -338,14 +343,18 @@ trait Trees {
final def hasFlag(mask: Long): Boolean = (mods.flags & mask) != 0
}

/** Package clause */
case class PackageDef(name: Name, stats: List[Tree])
/** Package clause
*/
case class PackageDef(pid: RefTree, stats: List[Tree])
extends MemberDef {
def name = pid.name
def mods = NoMods
}

/* disabled, as this is now dangerous
def PackageDef(sym: Symbol, stats: List[Tree]): PackageDef =
PackageDef(sym.name, stats) setSymbol sym
PackageDef(Ident(sym.name), stats) setSymbol sym
*/

abstract class ImplDef extends MemberDef {
def impl: Template
Expand Down Expand Up @@ -812,18 +821,18 @@ trait Trees {
def This(sym: Symbol): Tree = This(sym.name) setSymbol sym

/** Designator <qualifier> . <selector> */
case class Select(qualifier: Tree, selector: Name)
extends SymTree {
override def isTerm = selector.isTermName
override def isType = selector.isTypeName
case class Select(qualifier: Tree, name: Name)
extends RefTree {
override def isTerm = name.isTermName
override def isType = name.isTypeName
}

def Select(qualifier: Tree, sym: Symbol): Select =
Select(qualifier, sym.name) setSymbol sym

/** Identifier <name> */
case class Ident(name: Name)
extends SymTree {
extends RefTree {
override def isTerm = name.isTermName
override def isType = name.isTypeName
}
Expand Down Expand Up @@ -880,8 +889,8 @@ trait Trees {
extends TypTree

/** Type selection <qualifier> # <selector>, eliminated by RefCheck */
case class SelectFromTypeTree(qualifier: Tree, selector: Name)
extends TypTree with SymTree
case class SelectFromTypeTree(qualifier: Tree, name: Name)
extends TypTree with RefTree

/** Intersection type <parent1> with ... with <parentN> { <decls> }, eliminated by RefCheck */
case class CompoundTypeTree(templ: Template)
Expand Down Expand Up @@ -909,8 +918,8 @@ trait Trees {

/* A standard pattern match
case EmptyTree =>
case PackageDef(name, stats) =>
// package name { stats }
case PackageDef(pid, stats) =>
// package pid { stats }
case ClassDef(mods, name, tparams, impl) =>
// mods class name [tparams] impl where impl = extends parents { defs }
case ModuleDef(mods, name, impl) => (eliminated by refcheck)
Expand Down Expand Up @@ -1023,7 +1032,7 @@ trait Trees {

abstract class TreeCopier {
def ClassDef(tree: Tree, mods: Modifiers, name: Name, tparams: List[TypeDef], impl: Template): ClassDef
def PackageDef(tree: Tree, name: Name, stats: List[Tree]): PackageDef
def PackageDef(tree: Tree, pid: RefTree, stats: List[Tree]): PackageDef
def ModuleDef(tree: Tree, mods: Modifiers, name: Name, impl: Template): ModuleDef
def ValDef(tree: Tree, mods: Modifiers, name: Name, tpt: Tree, rhs: Tree): ValDef
def DefDef(tree: Tree, mods: Modifiers, name: Name, tparams: List[TypeDef], vparamss: List[List[ValDef]], tpt: Tree, rhs: Tree): DefDef
Expand Down Expand Up @@ -1071,8 +1080,8 @@ trait Trees {
class StrictTreeCopier extends TreeCopier {
def ClassDef(tree: Tree, mods: Modifiers, name: Name, tparams: List[TypeDef], impl: Template) =
new ClassDef(mods, name, tparams, impl).copyAttrs(tree);
def PackageDef(tree: Tree, name: Name, stats: List[Tree]) =
new PackageDef(name, stats).copyAttrs(tree)
def PackageDef(tree: Tree, pid: RefTree, stats: List[Tree]) =
new PackageDef(pid, stats).copyAttrs(tree)
def ModuleDef(tree: Tree, mods: Modifiers, name: Name, impl: Template) =
new ModuleDef(mods, name, impl).copyAttrs(tree)
def ValDef(tree: Tree, mods: Modifiers, name: Name, tpt: Tree, rhs: Tree) =
Expand Down Expand Up @@ -1166,10 +1175,10 @@ trait Trees {
if (mods0 == mods) && (name0 == name) && (tparams0 == tparams) && (impl0 == impl) => t
case _ => treeCopy.ClassDef(tree, mods, name, tparams, impl)
}
def PackageDef(tree: Tree, name: Name, stats: List[Tree]) = tree match {
case t @ PackageDef(name0, stats0)
if (name0 == name) && (stats0 == stats) => t
case _ => treeCopy.PackageDef(tree, name, stats)
def PackageDef(tree: Tree, pid: RefTree, stats: List[Tree]) = tree match {
case t @ PackageDef(pid0, stats0)
if (pid0 == pid) && (stats0 == stats) => t
case _ => treeCopy.PackageDef(tree, pid, stats)
}
def ModuleDef(tree: Tree, mods: Modifiers, name: Name, impl: Template) = tree match {
case t @ ModuleDef(mods0, name0, impl0)
Expand Down Expand Up @@ -1392,10 +1401,13 @@ trait Trees {
def transform(tree: Tree): Tree = tree match {
case EmptyTree =>
tree
case PackageDef(name, stats) =>
atOwner(tree.symbol.moduleClass) {
treeCopy.PackageDef(tree, name, transformStats(stats, currentOwner))
}
case PackageDef(pid, stats) =>
treeCopy.PackageDef(
tree, transform(pid).asInstanceOf[RefTree],
atOwner(tree.symbol.moduleClass) {
transformStats(stats, currentOwner)
}
)
case ClassDef(mods, name, tparams, impl) =>
atOwner(tree.symbol) {
treeCopy.ClassDef(tree, transformModifiers(mods), name,
Expand Down Expand Up @@ -1544,7 +1556,8 @@ trait Trees {
def traverse(tree: Tree): Unit = tree match {
case EmptyTree =>
;
case PackageDef(name, stats) =>
case PackageDef(pid, stats) =>
traverse(pid)
atOwner(tree.symbol.moduleClass) {
traverseTrees(stats)
}
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/scala/tools/nsc/ast/parser/BracePair.scala
Expand Up @@ -2,7 +2,8 @@
* Copyright 2005-2009 LAMP/EPFL
* @author Martin Odersky
*/
package scala.tools.nsc.ast.parser
package scala.tools.nsc
package ast.parser

/** A descriptor for a matching pair of braces.
* @param loff The offset of the opening brace (-1 means missing)
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala
Expand Up @@ -2,7 +2,8 @@
* Copyright 2005-2009 LAMP/EPFL
* @author Martin Odersky
*/
package scala.tools.nsc.ast.parser
package scala.tools.nsc
package ast.parser

/** A patch that postulates that a brace needs to be inserted or deleted at a given position.
* @param off The offset where the brace needs to be inserted or deleted
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
Expand Up @@ -4,7 +4,8 @@
*/
// $Id: MarkupParsers.scala 17754 2009-05-18 10:54:00Z milessabin $

package scala.tools.nsc.ast.parser
package scala.tools.nsc
package ast.parser

import scala.collection.mutable
import scala.util.control.ControlException
Expand Down

0 comments on commit 40707e0

Please sign in to comment.