aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-02-18 15:29:38 +0100
committerMartin Odersky <odersky@gmail.com>2013-02-18 15:29:38 +0100
commit5c9433161e116704730693254fdaf161c69cbcb5 (patch)
tree6c9adc3d7e3b91ee07f7335aac0479df68d67af2 /src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
parent2b4a19e80a643dfdf8eea5fa40811f76edb27be3 (diff)
downloaddotty-5c9433161e116704730693254fdaf161c69cbcb5.tar.gz
dotty-5c9433161e116704730693254fdaf161c69cbcb5.tar.bz2
dotty-5c9433161e116704730693254fdaf161c69cbcb5.zip
Improved position handling.
1. All positions are range position. 2. Improved position API 3. renamed Offset to Coord, and made sure indices cannot be confused with positions. 4. Trees now automatically get positions that enclose their subtree's positions. 5. typed DefTrees contain positions that also enclose their symbol's position. To make this work well, a symbol's coord should point to the introducing keyword (e.g. def, val, class).
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/ClassfileParser.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index 9ba2c46e5..9955d8b56 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -148,7 +148,7 @@ class ClassfileParser(
}
def parseMember(method: Boolean): Unit = {
- val start = new Offset(in.bp)
+ val start = indexCoord(in.bp)
val jflags = in.nextChar
val sflags =
if (method) FlagTranslation.methodFlags(jflags)
@@ -162,7 +162,7 @@ class ClassfileParser(
def complete(denot: LazySymDenotation) = {
val oldbp = in.bp
try {
- in.bp = denot.symbol.offset.value
+ in.bp = denot.symbol.coord.toIndex
val sym = denot.symbol
val jflags = in.nextChar
val isEnum = (jflags & JAVA_ACC_ENUM) != 0
@@ -335,7 +335,7 @@ class ClassfileParser(
while (sig(index) != '>') {
val tpname = subName(':'.==).toTypeName
val s = cctx.newLazySymbol(
- owner, tpname, Flags.TypeParam, new TypeParamCompleter(index), new Offset(index))
+ owner, tpname, Flags.TypeParam, new TypeParamCompleter(index), indexCoord(index))
tparams = tparams + (tpname -> s)
sig2typeBounds(tparams, skiptvs = true)
newTParams += s