summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2006-08-25 11:57:45 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2006-08-25 11:57:45 +0000
commit5a4ad1c3ffa2025e0d833139db6dc0f45f0839c8 (patch)
treee0c4b635228a9ebb02df891e0e90e57d31b5f567 /src/compiler/scala/tools/nsc/Global.scala
parent6d9e1774b9d543550473b3f32c4925d290c9edd1 (diff)
downloadscala-5a4ad1c3ffa2025e0d833139db6dc0f45f0839c8.tar.gz
scala-5a4ad1c3ffa2025e0d833139db6dc0f45f0839c8.tar.bz2
scala-5a4ad1c3ffa2025e0d833139db6dc0f45f0839c8.zip
Eliminated need for extra global class so Globa...
Eliminated need for extra global class so Global can remain concrete.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 891e35d98a..91fd77ab22 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -29,7 +29,7 @@ import backend.jvm.GenJVM
import backend.opt.{Inliners, ClosureElimination, DeadCodeElimination}
import backend.icode.analysis._
-abstract class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
+class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
with Trees
with CompilationUnits
{
@@ -612,4 +612,18 @@ abstract class Global(var settings: Settings, var reporter: Reporter) extends Sy
def forCLDC: Boolean = settings.target.value == "cldc"
def onlyPresentation = settings.doc.value
+ // position stuff
+ val positionConfiguration : PositionConfiguration = new PositionConfiguration {
+ type PositionType = Int;
+ def coercePosToInt(pos : PositionType) : Int = pos;
+ def coerceIntToPos(pos : Int) : PositionType = pos;
+ val NoPos : PositionType = Position.NOPOS;
+ val FirstPos : PositionType = Position.FIRSTPOS;
+ }
+ final type PositionType = positionConfiguration.PositionType;
+ final val FirstPos = positionConfiguration.FirstPos;
+ final val NoPos = positionConfiguration.NoPos;
+ final def coerceIntToPos(pos : Int) : PositionType = positionConfiguration.coerceIntToPos(pos);
+ implicit final def coercePosToInt(pos : PositionType) : Int = positionConfiguration.coercePosToInt(pos);
+
}