diff options
author | michelou <michelou@epfl.ch> | 2007-10-09 16:28:22 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-10-09 16:28:22 +0000 |
commit | f91bc93ad4767a86fea46d2d63e3b09cf2f64faf (patch) | |
tree | 37d901d19390abd0d769742354986b08a043aa86 /src/compiler | |
parent | d93d566e0845aeed5066c30b4bc0d99a2b4729c7 (diff) | |
download | scala-f91bc93ad4767a86fea46d2d63e3b09cf2f64faf.tar.gz scala-f91bc93ad4767a86fea46d2d63e3b09cf2f64faf.tar.bz2 scala-f91bc93ad4767a86fea46d2d63e3b09cf2f64faf.zip |
removed type aliases, update svn:keywords
Diffstat (limited to 'src/compiler')
12 files changed, 41 insertions, 32 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala b/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala index cabb1a075c..f07eddcdfe 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala @@ -1,4 +1,11 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2007 LAMP/EPFL + * @author Sean McDirmid + */ +// $Id$ + package scala.tools.nsc.ast.parser + import scala.tools.nsc.util.SourceFile._ import scala.tools.nsc.util._ @@ -735,7 +742,7 @@ trait NewScanners { } object ScannerConfiguration { - private var key: Array[byte] = _ + private var key: Array[Byte] = _ private var maxKey = 0 private var tokenName = new Array[global.Name](128); { @@ -806,18 +813,18 @@ trait NewScanners { enterKeyword(nme.ATkw, AT) // Build keyword array - key = new Array[byte](maxKey + 1) + key = new Array[Byte](maxKey + 1) for (i <- 0 to maxKey) key(i) = IDENTIFIER for (j <- 0 until tokenCount) if (tokenName(j) ne null) - key(tokenName(j).start) = j.asInstanceOf[byte] + key(tokenName(j).start) = j.asInstanceOf[Byte] } //Token representation ----------------------------------------------------- /** Convert name to token */ - def name2token(name: global.Name): int = + def name2token(name: global.Name): Int = if (name.start <= maxKey) key(name.start) else IDENTIFIER def isKeyword(code : Int) = code match { @@ -825,7 +832,7 @@ trait NewScanners { case _ => false } /** Returns the string representation of given token. */ - def token2string(token: int): String = token match { + def token2string(token: Int): String = token match { case IDENTIFIER | BACKQUOTED_IDENT => "identifier" case CHARLIT => "character literal" case INTLIT => "integer literal" diff --git a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala index 2a244f028d..cc5f3b5505 100644 --- a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala +++ b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala @@ -297,11 +297,11 @@ trait TransMatcher { self: transform.ExplicitOuter with PatternNodes with Parall } object resetTrav extends Traverser { - override def traverse(x:Tree): unit = x match { - case vd @ ValDef(_,_,_,_)=> - if(vd.symbol.hasFlag(symtab.Flags.SYNTHETIC)) { - vd.symbol.resetFlag(symtab.Flags.TRANS_FLAG) - vd.symbol.resetFlag(symtab.Flags.MUTABLE) + override def traverse(x: Tree): Unit = x match { + case vd @ ValDef(_, _, _, _) => + if (vd.symbol hasFlag symtab.Flags.SYNTHETIC) { + vd.symbol resetFlag symtab.Flags.TRANS_FLAG + vd.symbol resetFlag symtab.Flags.MUTABLE } case _ => super.traverse(x) diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/PickleBuffer.scala b/src/compiler/scala/tools/nsc/symtab/classfile/PickleBuffer.scala index 986fc11ffd..f858d52734 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/PickleBuffer.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/PickleBuffer.scala @@ -78,7 +78,7 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) { val y = x >> 8 val z = x & 0xff if (-y != (z >> 7)) writeLong(y) - writeByte(z.asInstanceOf[int]) + writeByte(z.asInstanceOf[Int]) } // -- Basic input routines -------------------------------------------- diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index a60333f005..c969dc2f52 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -52,7 +52,7 @@ abstract class Pickler extends SubComponent { var i = 0 while (i < pickle.writeIndex) { unit.pickleHash += pickle.bytes(i).toLong // toLong needed to work around bug - i = i + 1 + i += 1 } } case _ => @@ -67,7 +67,7 @@ abstract class Pickler extends SubComponent { import scala.collection.jcl.LinkedHashMap private var entries = new Array[AnyRef](256) private var ep = 0 - private val index = new LinkedHashMap[AnyRef, int] + private val index = new LinkedHashMap[AnyRef, Int] /** Is root in symbol.owner*? * @@ -336,7 +336,7 @@ abstract class Pickler extends SubComponent { var posOffset = 0 writeRef(sym.name) writeRef(sym.owner) - writeNat((sym.flags & PickledFlags).asInstanceOf[int]) + writeNat((sym.flags & PickledFlags).asInstanceOf[Int]) if (sym.privateWithin != NoSymbol) writeRef(sym.privateWithin) writeRef(sym.info) posOffset diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 2bff857011..a2575e59ad 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -492,11 +492,11 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { * @param pt ... * @return the adapted tree */ - override protected def adapt(tree: Tree, mode: int, pt: Type): Tree = + override protected def adapt(tree: Tree, mode: Int, pt: Type): Tree = adaptToType(tree, pt) /** A replacement for the standard typer's `typed1' method */ - override protected def typed1(tree: Tree, mode: int, pt: Type): Tree = { + override protected def typed1(tree: Tree, mode: Int, pt: Type): Tree = { var tree1 = try { super.typed1(adaptMember(tree), mode, pt) } catch { diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 113c5f1296..cd48899c17 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -22,7 +22,7 @@ abstract class ExplicitOuter extends InfoTransform with TransMatcher with Patter import posAssigner.atPos /** The following flags may be set by this phase: */ - override def phaseNewFlags: long = notPRIVATE | notPROTECTED | lateFINAL + override def phaseNewFlags: Long = notPRIVATE | notPROTECTED | lateFINAL /** the name of the phase: */ val phaseName: String = "explicitouter" diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala index 1ec4da1a54..defcc6ce2e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2006 LAMP/EPFL + * Copyright 2005-2007 LAMP/EPFL * @author Martin Odersky */ // $Id$ @@ -18,15 +18,16 @@ trait Analyzer extends AnyRef with SyntheticMethods with Unapplies { - val global : Global; - import global._; + val global : Global + import global._ object namerFactory extends SubComponent { val global: Analyzer.this.global.type = Analyzer.this.global val phaseName = "namer" def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) { - def apply(unit: CompilationUnit): unit = + def apply(unit: CompilationUnit) { newNamer(rootContext(unit)).enterSym(unit.body) + } } } @@ -35,8 +36,9 @@ trait Analyzer extends AnyRef val phaseName = "typer" def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) { resetTyper - def apply(unit: CompilationUnit): unit = + def apply(unit: CompilationUnit) { unit.body = newTyper(rootContext(unit)).typed(unit.body) + } } } } diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index ee1637c65a..f0311dd885 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -55,7 +55,7 @@ trait Contexts { self: Analyzer => def rootContext(unit: CompilationUnit): Context = rootContext(unit, EmptyTree, false) - def rootContext(unit: CompilationUnit, tree: Tree, erasedTypes: boolean): Context = { + def rootContext(unit: CompilationUnit, tree: Tree, erasedTypes: Boolean): Context = { import definitions._ var sc = startContext def addImport(pkg: Symbol) { @@ -423,7 +423,7 @@ trait Contexts { self: Analyzer => * @param superAccess ... * @return ... */ - def isAccessible(sym: Symbol, pre: Type, superAccess: boolean): boolean = { + def isAccessible(sym: Symbol, pre: Type, superAccess: Boolean): Boolean = { /** Are we inside definition of `owner'? */ def accessWithin(owner: Symbol): Boolean = { diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 869d16aac5..695cb60f5e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -473,7 +473,7 @@ abstract class RefChecks extends InfoTransform { } private var currentLevel: LevelInfo = null - private val symIndex = new HashMap[Symbol, int] + private val symIndex = new HashMap[Symbol, Int] private def pushLevel() { currentLevel = new LevelInfo(currentLevel) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index f3a54e716a..ef07b183f3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -482,7 +482,7 @@ trait Typers { self: Analyzer => * <!--(3)--><li>Turn tree type into stable type if possible and required by context.</li> * </ol> */ - private def stabilize(tree: Tree, pre: Type, mode: int, pt: Type): Tree = { + private def stabilize(tree: Tree, pre: Type, mode: Int, pt: Type): Tree = { def isDeprecated(sym: Symbol) = sym.isDeprecated if (tree.symbol.hasFlag(OVERLOADED) && (mode & FUNmode) == 0) inferExprAlternative(tree, pt) @@ -607,7 +607,7 @@ trait Typers { self: Analyzer => * (13) When in mode EXPRmode, apply a view * If all this fails, error */ - protected def adapt(tree: Tree, mode: int, pt: Type): Tree = tree.tpe match { + protected def adapt(tree: Tree, mode: Int, pt: Type): Tree = tree.tpe match { case ct @ ConstantType(value) if ((mode & TYPEmode) == 0 && (ct <:< pt) && !inIDE) => // (0) copy.Literal(tree, value) case OverloadedType(pre, alts) if ((mode & FUNmode) == 0) => // (1) @@ -799,7 +799,7 @@ trait Typers { self: Analyzer => * @param pt ... * @return ... */ - def instantiate(tree: Tree, mode: int, pt: Type): Tree = { + def instantiate(tree: Tree, mode: Int, pt: Type): Tree = { val tparams = context.undetparams context.undetparams = List() inferExprInstance(tree, tparams, pt) @@ -2017,7 +2017,7 @@ trait Typers { self: Analyzer => * @param pt ... * @return ... */ - protected def typed1(tree: Tree, mode: int, pt: Type): Tree = { + protected def typed1(tree: Tree, mode: Int, pt: Type): Tree = { //Console.println("typed1("+tree.getClass()+","+Integer.toHexString(mode)+","+pt+")") def ptOrLub(tps: List[Type]) = if (isFullyDefined(pt)) pt else lub(tps map (_.deconst)) diff --git a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala index 4f99ecc221..dd971bc981 100644 --- a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala +++ b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala @@ -9,9 +9,9 @@ package scala.tools.nsc.util import scala.tools.nsc.util.SourceFile.{LF, FF, CR, SU} class CharArrayReader(buf: RandomAccessSeq[Char], start: Int, /* startline: int, startcol: int, */ - decodeUni: Boolean, error: String => unit) extends Iterator[Char] { + decodeUni: Boolean, error: String => Unit) extends Iterator[Char] { - def this(buf: RandomAccessSeq[Char], decodeUni: Boolean, error: String => unit) = + def this(buf: RandomAccessSeq[Char], decodeUni: Boolean, error: String => Unit) = this(buf, 0, /* 1, 1, */ decodeUni, error) /** layout constant diff --git a/src/compiler/scala/tools/nsc/util/NewCharArrayReader.scala b/src/compiler/scala/tools/nsc/util/NewCharArrayReader.scala index 3f889587ed..f667063b5a 100644 --- a/src/compiler/scala/tools/nsc/util/NewCharArrayReader.scala +++ b/src/compiler/scala/tools/nsc/util/NewCharArrayReader.scala @@ -9,7 +9,7 @@ package scala.tools.nsc.util import scala.tools.nsc.util.SourceFile.{LF, FF, CR, SU} class NewCharArrayReader(val buf: RandomAccessSeq[Char], // should not change - decodeUni: Boolean, error: (Int,String) => unit) extends Iterator[Char] { + decodeUni: Boolean, error: (Int,String) => Unit) extends Iterator[Char] { private var idx : Int = 0 private var isUnicode0 = false def isUnicode = isUnicode0 |