Permalink
Browse files

moves positions to scala.reflect.internal.util

This is the first step of factoring out scala-reflect.jar.
  • Loading branch information...
xeno-by committed Jun 4, 2012
1 parent 3896a41 commit d9103e01b467634d61baa3b131aeb93fca9e20a5
Showing with 188 additions and 111 deletions.
  1. +1 −1 src/compiler/scala/reflect/internal/Kinds.scala
  2. +2 −2 src/compiler/scala/reflect/internal/Positions.scala
  3. +0 −1 src/compiler/scala/reflect/internal/SymbolTable.scala
  4. +1 −1 src/compiler/scala/reflect/internal/Types.scala
  5. +1 −2 src/compiler/scala/{tools/nsc → reflect/internal}/util/Position.scala
  6. +2 −3 src/compiler/scala/{tools/nsc → reflect/internal}/util/SourceFile.scala
  7. +1 −2 src/compiler/scala/{tools → reflect/internal}/util/StringOps.scala
  8. +1 −2 src/compiler/scala/{tools/nsc → reflect/internal}/util/TableDef.scala
  9. +1 −1 src/compiler/scala/{tools/nsc → reflect/internal}/util/WeakHashSet.scala
  10. +1 −1 src/compiler/scala/reflect/makro/runtime/AbortMacroException.scala
  11. +1 −1 src/compiler/scala/reflect/runtime/JavaUniverse.scala
  12. +2 −1 src/compiler/scala/tools/nsc/CompilationUnits.scala
  13. +1 −1 src/compiler/scala/tools/nsc/CompileServer.scala
  14. +1 −1 src/compiler/scala/tools/nsc/CompileSocket.scala
  15. +1 −1 src/compiler/scala/tools/nsc/Driver.scala
  16. +2 −1 src/compiler/scala/tools/nsc/Global.scala
  17. +1 −1 src/compiler/scala/tools/nsc/Main.scala
  18. +1 −1 src/compiler/scala/tools/nsc/Phases.scala
  19. +1 −1 src/compiler/scala/tools/nsc/ScalaDoc.scala
  20. +1 −1 src/compiler/scala/tools/nsc/ast/DocComments.scala
  21. +2 −2 src/compiler/scala/tools/nsc/ast/Positions.scala
  22. +2 −1 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
  23. +3 −2 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  24. +2 −1 src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
  25. +1 −1 src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala
  26. +1 −1 src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala
  27. +1 −1 src/compiler/scala/tools/nsc/backend/icode/Members.scala
  28. +1 −1 src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala
  29. +1 −1 src/compiler/scala/tools/nsc/backend/icode/Printers.scala
  30. +1 −1 src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
  31. +2 −2 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
  32. +1 −1 src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
  33. +1 −1 src/compiler/scala/tools/nsc/doc/DocFactory.scala
  34. +1 −1 src/compiler/scala/tools/nsc/doc/DocParser.scala
  35. +1 −1 src/compiler/scala/tools/nsc/doc/model/TreeFactory.scala
  36. +1 −1 src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
  37. +1 −1 src/compiler/scala/tools/nsc/interactive/BuildManager.scala
  38. +2 −1 src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
  39. +1 −1 src/compiler/scala/tools/nsc/interactive/ContextTrees.scala
  40. +2 −1 src/compiler/scala/tools/nsc/interactive/Global.scala
  41. +1 −1 src/compiler/scala/tools/nsc/interactive/InteractiveReporter.scala
  42. +4 −2 src/compiler/scala/tools/nsc/interactive/Picklers.scala
  43. +2 −2 src/compiler/scala/tools/nsc/interactive/REPL.scala
  44. +2 −1 src/compiler/scala/tools/nsc/interactive/RangePositions.scala
  45. +2 −1 src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
  46. +1 −1 src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala
  47. +1 −1 src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala
  48. +1 −1 src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala
  49. +2 −2 src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala
  50. +1 −1 src/compiler/scala/tools/nsc/interactive/tests/Tester.scala
  51. +2 −2 src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala
  52. +1 −1 src/compiler/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala
  53. +2 −2 src/compiler/scala/tools/nsc/interactive/tests/core/PresentationCompilerRequestsWorkingMode.scala
  54. +1 −1 src/compiler/scala/tools/nsc/interactive/tests/core/PresentationCompilerTestDef.scala
  55. +1 −1 src/compiler/scala/tools/nsc/interactive/tests/core/SourcesCollector.scala
  56. +1 −1 src/compiler/scala/tools/nsc/interactive/tests/core/TestResources.scala
  57. +1 −1 src/compiler/scala/tools/nsc/interpreter/ExprTyper.scala
  58. +1 −1 src/compiler/scala/tools/nsc/interpreter/ILoopInit.scala
  59. +2 −1 src/compiler/scala/tools/nsc/interpreter/IMain.scala
  60. +1 −1 src/compiler/scala/tools/nsc/interpreter/Power.scala
  61. +1 −1 src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
  62. +2 −0 src/compiler/scala/tools/nsc/io/AbstractFile.scala
  63. +3 −0 src/compiler/scala/tools/nsc/io/Directory.scala
  64. +2 −0 src/compiler/scala/tools/nsc/io/File.scala
  65. +2 −0 src/compiler/scala/tools/nsc/io/NoAbstractFile.scala
  66. +4 −1 src/compiler/scala/tools/nsc/io/Path.scala
  67. +1 −1 src/compiler/scala/tools/nsc/io/SourceReader.scala
  68. +2 −0 src/compiler/scala/tools/nsc/io/VirtualFile.scala
  69. +2 −0 src/compiler/scala/tools/nsc/io/ZipArchive.scala
  70. +1 −1 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
  71. +2 −1 src/compiler/scala/tools/nsc/javac/JavaScanners.scala
  72. +1 −1 src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
  73. +3 −2 src/compiler/scala/tools/nsc/plugins/Plugin.scala
  74. +1 −1 src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala
  75. +1 −2 src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala
  76. +4 −5 src/compiler/scala/tools/nsc/reporters/Reporter.scala
  77. +1 −1 src/compiler/scala/tools/nsc/reporters/StoreReporter.scala
  78. +1 −1 src/compiler/scala/tools/nsc/scratchpad/SourceInserter.scala
  79. +4 −3 src/compiler/scala/tools/nsc/settings/MutableSettings.scala
  80. +1 −1 src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala
  81. +1 −1 src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala
  82. +2 −2 src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
  83. +1 −1 src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
  84. +1 −1 src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
  85. +1 −1 src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
  86. +1 −1 src/compiler/scala/tools/nsc/typechecker/Typers.scala
  87. +1 −1 src/compiler/scala/tools/nsc/util/ClassPath.scala
  88. +1 −1 src/compiler/scala/tools/nsc/util/Exceptional.scala
  89. +2 −2 src/compiler/scala/tools/nsc/util/FreshNameCreator.scala
  90. +53 −0 src/compiler/scala/tools/nsc/util/package.scala
  91. +1 −1 src/compiler/scala/tools/reflect/FrontEnds.scala
  92. +3 −3 src/compiler/scala/tools/reflect/ToolBoxFactory.scala
@@ -7,7 +7,7 @@ package scala.reflect
package internal
import scala.collection.{ mutable, immutable }
import scala.tools.util.StringOps.{ countAsString, countElementsAsString }
import scala.reflect.internal.util.StringOps.{ countAsString, countElementsAsString }
trait Kinds {
self: SymbolTable =>
@@ -3,8 +3,8 @@ package internal
trait Positions extends api.Positions { self: SymbolTable =>
type Position = scala.tools.nsc.util.Position
val NoPosition = scala.tools.nsc.util.NoPosition
type Position = scala.reflect.internal.util.Position
val NoPosition = scala.reflect.internal.util.NoPosition
implicit val PositionTag = ClassTag[Position](classOf[Position])
/** A position that wraps a set of trees.
@@ -8,7 +8,6 @@ package internal
import scala.collection.{ mutable, immutable }
import util._
import scala.tools.nsc.util.WeakHashSet
abstract class SymbolTable extends makro.Universe
with Collections
@@ -5995,7 +5995,7 @@ trait Types extends api.Types { self: SymbolTable =>
// Lubs and Glbs ---------------------------------------------------------
private def printLubMatrix(btsMap: Map[Type, List[Type]], depth: Int) {
import scala.tools.nsc.util.TableDef
import util.TableDef
import TableDef.Column
def str(tp: Type) = {
if (tp == NoType) ""
@@ -4,8 +4,7 @@
*
*/
package scala.tools.nsc
package util
package scala.reflect.internal.util
import reflect.ClassTag
import reflect.base.Attachments
@@ -4,10 +4,9 @@
*/
package scala.tools.nsc
package util
package scala.reflect.internal.util
import io.{ AbstractFile, VirtualFile }
import scala.tools.nsc.io.{ AbstractFile, VirtualFile }
import scala.collection.mutable.ArrayBuffer
import annotation.tailrec
import java.util.regex.Pattern
@@ -7,8 +7,7 @@
\* */
package scala.tools
package util
package scala.reflect.internal.util
/** This object provides utility methods to extract elements
* from Strings.
@@ -1,5 +1,4 @@
package scala.tools.nsc
package util
package scala.reflect.internal.util
import TableDef._
@@ -1,4 +1,4 @@
package scala.tools.nsc.util
package scala.reflect.internal.util
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
@@ -1,6 +1,6 @@
package scala.reflect.makro
package runtime
import scala.tools.nsc.util.Position
import scala.reflect.internal.util.Position
class AbortMacroException(val pos: Position, val msg: String) extends Throwable(msg)
@@ -14,7 +14,7 @@ class JavaUniverse extends internal.SymbolTable with ReflectSetup with runtime.S
type TreeGen = internal.TreeGen
override type Position = scala.tools.nsc.util.Position
override type Position = scala.reflect.internal.util.Position
override val gen = new TreeGen { val global: self.type = self }
@@ -5,7 +5,8 @@
package scala.tools.nsc
import util.{ FreshNameCreator, Position, NoPosition, BatchSourceFile, SourceFile, NoSourceFile }
import util.FreshNameCreator
import scala.reflect.internal.util.{ Position, NoPosition, BatchSourceFile, SourceFile, NoSourceFile }
import scala.collection.mutable
import scala.collection.mutable.{ LinkedHashSet, ListBuffer }
@@ -7,7 +7,7 @@ package scala.tools.nsc
import java.io.{ BufferedOutputStream, FileOutputStream, PrintStream }
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
import scala.tools.nsc.util.FakePos //Position
import scala.reflect.internal.util.FakePos //Position
import scala.tools.util.SocketServer
import settings.FscSettings
@@ -13,7 +13,7 @@ import java.security.SecureRandom
import io.{ File, Path, Directory, Socket }
import scala.util.control.Exception.catching
import scala.tools.util.CompileOutputCommon
import scala.tools.util.StringOps.splitWhere
import scala.reflect.internal.util.StringOps.splitWhere
import scala.sys.process._
trait HasCompileSocket {
@@ -2,7 +2,7 @@ package scala.tools.nsc
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
import Properties.{ versionString, copyrightString }
import scala.tools.nsc.util.{ BatchSourceFile, FakePos }
import scala.reflect.internal.util.{ BatchSourceFile, FakePos }
abstract class Driver {
@@ -12,7 +12,8 @@ import scala.tools.util.PathResolver
import scala.collection.{ mutable, immutable }
import io.{ SourceReader, AbstractFile, Path }
import reporters.{ Reporter, ConsoleReporter }
import util.{ NoPosition, Exceptional, ClassPath, MergedClassPath, SourceFile, NoSourceFile, Statistics, StatisticsInfo, BatchSourceFile, ScriptSourceFile, ScalaClassLoader, returning }
import util.{ Exceptional, ClassPath, MergedClassPath, Statistics, StatisticsInfo, ScalaClassLoader, returning }
import scala.reflect.internal.util.{ NoPosition, SourceFile, NoSourceFile, BatchSourceFile, ScriptSourceFile }
import scala.reflect.internal.pickling.{ PickleBuffer, PickleFormat }
import settings.{ AestheticSettings }
import symtab.{ Flags, SymbolTable, SymbolLoaders, SymbolTrackers }
@@ -11,7 +11,7 @@ import File.pathSeparator
import scala.tools.nsc.interactive.{ RefinedBuildManager, SimpleBuildManager }
import scala.tools.nsc.io.AbstractFile
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
import scala.tools.nsc.util.{ BatchSourceFile, FakePos } //{Position}
import scala.reflect.internal.util.{ BatchSourceFile, FakePos } //{Position}
import Properties.{ versionString, copyrightString, residentPromptString, msilLibPath }
/** The main class for NSC, a compiler for the programming
@@ -6,7 +6,7 @@
package scala.tools.nsc
import symtab.Flags
import util.TableDef
import reflect.internal.util.TableDef
import language.postfixOps
object Phases {
@@ -9,7 +9,7 @@ package scala.tools.nsc
import java.io.File.pathSeparator
import scala.tools.nsc.doc.DocFactory
import scala.tools.nsc.reporters.ConsoleReporter
import scala.tools.nsc.util.FakePos
import scala.reflect.internal.util.FakePos
import Properties.msilLibPath
/** The main class for scaladoc, a front-end for the Scala compiler
@@ -8,7 +8,7 @@ package ast
import symtab._
import reporters._
import util.{Position, NoPosition}
import scala.reflect.internal.util.{Position, NoPosition}
import util.DocStrings._
import scala.reflect.internal.Chars._
import scala.collection.mutable
@@ -1,7 +1,7 @@
package scala.tools.nsc
package ast
import scala.tools.nsc.util.{ SourceFile, Position, OffsetPosition, NoPosition }
import scala.reflect.internal.util.{ SourceFile, Position, OffsetPosition, NoPosition }
trait Positions extends scala.reflect.internal.Positions {
self: Global =>
@@ -14,7 +14,7 @@ trait Positions extends scala.reflect.internal.Positions {
// [Eugene] disabling this for now. imo it doesn't justify pollution of the public API
// override def _checkSetAnnotation(tree: Tree, annot: TreeAnnotation): Unit = {
// if (tree.pos != NoPosition && tree.pos != annot.pos) debugwarn("Overwriting annotation "+ tree.annotation +" of tree "+ tree +" with annotation "+ annot)
// // if ((tree.annotation.isInstanceOf[scala.tools.nsc.util.Position] || !annot.isInstanceOf[scala.tools.nsc.util.Position]) && tree.isInstanceOf[Block])
// // if ((tree.annotation.isInstanceOf[scala.reflect.internal.util.Position] || !annot.isInstanceOf[scala.reflect.internal.util.Position]) && tree.isInstanceOf[Block])
// // println("Updating block from "+ tree.annotation +" to "+ annot)
// }
@@ -9,7 +9,8 @@ package ast.parser
import scala.collection.mutable
import mutable.{ Buffer, ArrayBuffer, ListBuffer }
import scala.util.control.ControlThrowable
import scala.tools.nsc.util.{SourceFile,CharArrayReader}
import scala.tools.nsc.util.CharArrayReader
import scala.reflect.internal.util.SourceFile
import scala.xml.{ Text, TextBuffer }
import scala.xml.parsing.MarkupParserCommon
import scala.xml.Utility.{ isNameStart, isNameChar, isSpace }
@@ -10,10 +10,11 @@ package scala.tools.nsc
package ast.parser
import scala.collection.mutable.{ListBuffer, StringBuilder}
import util.{ SourceFile, OffsetPosition, FreshNameCreator }
import scala.reflect.internal.{ ModifierFlags => Flags }
import Tokens._
import scala.reflect.internal.Chars.{ isScalaLetter }
import scala.reflect.internal.util.{ SourceFile, OffsetPosition }
import Tokens._
import util.FreshNameCreator
/** Historical note: JavaParsers started life as a direct copy of Parsers
* but at a time when that Parsers had been replaced by a different one.
@@ -5,7 +5,8 @@
package scala.tools.nsc
package ast.parser
import scala.tools.nsc.util._
import scala.tools.nsc.util.CharArrayReader
import scala.reflect.internal.util._
import scala.reflect.internal.Chars._
import Tokens._
import scala.annotation.switch
@@ -10,7 +10,7 @@ import scala.collection.{ mutable, immutable }
import xml.{ EntityRef, Text }
import xml.XML.{ xmlns }
import symtab.Flags.MUTABLE
import scala.tools.util.StringOps.splitWhere
import scala.reflect.internal.util.StringOps.splitWhere
import language.implicitConversions
/** This class builds instance of `Tree` that represent XML.
@@ -9,7 +9,7 @@ package icode
import scala.collection.{ mutable, immutable }
import mutable.{ ListBuffer, ArrayBuffer }
import util.{ Position, NoPosition }
import scala.reflect.internal.util.{ Position, NoPosition }
import backend.icode.analysis.ProgramPoint
import language.postfixOps
@@ -9,7 +9,7 @@ package icode
import java.io.PrintWriter
import scala.collection.{ mutable, immutable }
import util.{ SourceFile, NoSourceFile }
import scala.reflect.internal.util.{ SourceFile, NoSourceFile }
import symtab.Flags.{ DEFERRED }
trait ReferenceEquality {
@@ -10,7 +10,7 @@ package backend
package icode
import scala.tools.nsc.ast._
import scala.tools.nsc.util.{Position,NoPosition}
import scala.reflect.internal.util.{Position,NoPosition}
/*
A pattern match
@@ -9,7 +9,7 @@ package icode
import java.io.PrintWriter
import scala.tools.nsc.symtab.Flags
import scala.tools.nsc.util.Position
import scala.reflect.internal.util.Position
trait Printers { self: ICodes =>
import global._
@@ -11,7 +11,7 @@ import java.nio.ByteBuffer
import scala.collection.{ mutable, immutable }
import scala.reflect.internal.pickling.{ PickleFormat, PickleBuffer }
import scala.tools.nsc.symtab._
import scala.tools.nsc.util.{ SourceFile, NoSourceFile }
import scala.reflect.internal.util.{ SourceFile, NoSourceFile }
import scala.reflect.internal.ClassfileConstants._
import ch.epfl.lamp.fjbg._
import JAccessFlags._
@@ -9,7 +9,7 @@ package backend.opt
import scala.collection.mutable
import scala.tools.nsc.symtab._
import scala.tools.nsc.util.NoSourceFile
import scala.reflect.internal.util.NoSourceFile
/**
* @author Iulian Dragos
@@ -100,7 +100,7 @@ abstract class Inliners extends SubComponent {
}
def isBottomType(sym: Symbol) = sym == NullClass || sym == NothingClass
def posToStr(pos: util.Position) = if (pos.isDefined) pos.point.toString else "<nopos>"
def posToStr(pos: scala.reflect.internal.util.Position) = if (pos.isDefined) pos.point.toString else "<nopos>"
/** Is the given class a closure? */
def isClosureClass(cls: Symbol): Boolean =
@@ -1,11 +1,11 @@
package scala.tools.nsc
package dependencies
import util.SourceFile
import io.Path
import collection._
import symtab.Flags
import scala.tools.nsc.io.AbstractFile
import scala.reflect.internal.util.SourceFile
trait DependencyAnalysis extends SubComponent with Files {
import global._
@@ -8,7 +8,7 @@ package doc
import scala.util.control.ControlThrowable
import reporters.Reporter
import util.{ NoPosition, BatchSourceFile}
import scala.reflect.internal.util.{ NoPosition, BatchSourceFile}
import io.{ File, Directory }
import DocParser.Parsed
@@ -8,7 +8,7 @@ package nsc
package doc
import reporters._
import util._
import scala.reflect.internal.util._
import interactive.RangePositions
import DocParser.Parsed
@@ -3,7 +3,7 @@ package doc
package model
import scala.collection._
import util.{RangePosition, OffsetPosition, SourceFile}
import scala.reflect.internal.util.{RangePosition, OffsetPosition, SourceFile}
/** The goal of this trait is , using makeTree,
* to browse a tree to
@@ -12,7 +12,7 @@ import reporters.Reporter
import scala.collection._
import scala.util.matching.Regex
import scala.annotation.switch
import util.{NoPosition, Position}
import scala.reflect.internal.util.{NoPosition, Position}
import language.postfixOps
/** The comment parser transforms raw comment strings into `Comment` objects.
@@ -9,7 +9,7 @@ package interactive
import scala.collection._
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
import util.FakePos
import scala.reflect.internal.util.FakePos
import dependencies._
import io.AbstractFile
@@ -7,11 +7,12 @@ package interactive
import scala.util.control.ControlThrowable
import scala.tools.nsc.io.AbstractFile
import scala.tools.nsc.util.{SourceFile, Position, WorkScheduler}
import scala.tools.nsc.symtab._
import scala.tools.nsc.ast._
import scala.tools.nsc.util.FailedInterrupt
import scala.tools.nsc.util.EmptyAction
import scala.tools.nsc.util.WorkScheduler
import scala.reflect.internal.util.{SourceFile, Position}
/** Interface of interactive compiler to a client such as an IDE
* The model the presentation compiler consists of the following parts:
@@ -6,7 +6,7 @@ package scala.tools.nsc
package interactive
import collection.mutable.ArrayBuffer
import util.Position
import scala.reflect.internal.util.Position
trait ContextTrees { self: Global =>
@@ -11,7 +11,8 @@ import mutable.{LinkedHashMap, SynchronizedMap, HashSet, SynchronizedSet}
import scala.concurrent.SyncVar
import scala.util.control.ControlThrowable
import scala.tools.nsc.io.{ AbstractFile, LogReplay, Logger, NullLogger, Replayer }
import scala.tools.nsc.util.{ SourceFile, BatchSourceFile, Position, RangePosition, NoPosition, WorkScheduler, MultiHashMap }
import scala.tools.nsc.util.{ WorkScheduler, MultiHashMap }
import scala.reflect.internal.util.{ SourceFile, BatchSourceFile, Position, RangePosition, NoPosition }
import scala.tools.nsc.reporters._
import scala.tools.nsc.symtab._
import scala.tools.nsc.ast._
Oops, something went wrong.

0 comments on commit d9103e0

Please sign in to comment.